Improvement suggestion for useFocusNotifyOnChangeProps #7424
Unanswered
sadeghhosseini
asked this question in
Show and tell
Replies: 1 comment
-
Same happened with me. Steps:
Works good with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think the implementation for
useFocusNotifyOnChangeProps
provided in the documents can be improved. The suggested implementation did not work for me, even though after invalidation of the query, the query was refetched successfully, but the component that used the query did not re-render for some reason! I changed the implementation to following and it worked. Regardless of whether the problem was in my code or in the suggested implementation, I think following implementation is better, because react navigation hasuseIsFocused
hook which tells you whether the current screen is in focus or not, so we can use this instead of re-implementing the functionality.Beta Was this translation helpful? Give feedback.
All reactions