You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 3, 2022. It is now read-only.
The following code is likely to produce an infinite loop, even if we make sure the dependency is stable using a ref, because useFocusEffect use "navigation" as a dependency and the object is unstable.
@satya164 what do you think about using a useNavigationRef hook as you suggested in some other issue? Didn't get a clear answer from the React team on how to handle this kind of situation but that should work. Or maybe I should depend only on isFocused and addListener which are the only 2 fn used, but if core does not guarantee stability across render the problem remains.
Reported by in https://github.com/react-navigation/hooks/pull/43/files#r334335721 by @ArrayZoneYour
The following code is likely to produce an infinite loop, even if we make sure the dependency is stable using a ref, because useFocusEffect use "navigation" as a dependency and the object is unstable.
The focus effect might retrigger unnecessarily due to the navigation being unstable
Somehow this is related to #40
@satya164 what do you think about using a
useNavigationRefhook as you suggested in some other issue? Didn't get a clear answer from the React team on how to handle this kind of situation but that should work. Or maybe I should depend only onisFocusedandaddListenerwhich are the only 2 fn used, but if core does not guarantee stability across render the problem remains.