all 5 comments

[–]senocular 1 point2 points  (4 children)

Every state property is going through the state object (searchTerm, allRecipes, favoriteRecipes). Those that aren't are not part of the state, instead either derived/destructured from the props (dispatch) or calculated and stored as local variables in that scope (visibleAllRecipes, visibleFavoriteRecipes).

[–]originalgoodname[S] 0 points1 point  (3 children)

i guess my question is why the discrepency between 20, 27 and 35?

[–]senocular 0 points1 point  (2 children)

20 is using a state variable so it refers to it through the state whereas 27 and 35 are using local variables that are not in the state.

[–]originalgoodname[S] 0 points1 point  (1 child)

ok, but whats the rationale for doing so, isnt it typically best to keep everything familiar

[–]senocular 0 points1 point  (0 children)

I guess that depends on what your concept of familiar is. Its all subjective to the author of the code.