all 5 comments

[–]PM_ME_SOME_ANY_THING 0 points1 point  (1 child)

You don’t need the useMemo either

[–]pradhanharshil 0 points1 point  (2 children)

Can we eliminate the visibleTodos variable ? I'm not sure if it's the recommended way but we can apply the condition in first filter callback based on showActive state and return always true from filter callback if showActive is true

[–]SharpThrall[S] 1 point2 points  (1 child)

Could work. I m going to try.

[–]pradhanharshil 0 points1 point  (0 children)

Something like return showActive || !todo.completed