✅ – ✅ – Alforoan – 19-31 Jan 2
how do u find a length of a list made by filter inside a component?
Solution:Jump to solution
If you would do it correctly, then server bot would take an action and post some feedback here
68 Replies
what im trying to do for context:
i want 'Completed' text to only appear if i have the task completed (isCompleted = true) but idk how to access isCompleted variable because the Completed function is in a different file
![](https://utfs.io/f/7bf83ae3-4393-4aa0-912a-438a29647f99-1nq2cb.png)
So you only need to call that function from other file to get that value?
export
it from the other file and import
to the one you need ityea
i did and have this line
but thats not working as intended
i also tried Completed.isCompleted === true ? "Completed" : ""
but i feel like im missing something here
What is inside
Completed
variable?
i was thinking about giving the array a name cuz i thought Completed.length didnt make much sense, but since it was so long i didnt know what to do
Oh, so
Completed
is a componentyea
So
length
refers to it's arguments length and not what you are trying to read 😛right
So
isCompleted
is a prop of each item of tasks
array, which is passed to Completed
component?yes
this is from Tasks.js file
Completed component is in Completed.js file
i have the repo if that'd be better
So you can import that
tasks
array in your target place without worrying about that Completed
function, right?right
https://gyazo.com/402cb85321017df6fb758c95dd0e5259 example of how it works
Gyazo
Gyazo
except I want the 'completed' text to only appear if the task.title is crossed out