Similar to React useEffect
, but only runs when the current route is focused. This is directly based off React Navigation's useFocusEffect.
You must pass it an array as the second argument to determine memoization, otherwise the effect will not change.
Example:
Edit this page on GitHub.