Mastering React’s Stable Values
UseState and useReducer return a state update function that is constant – the hook will always return the same function. UseFocusEffect has to assume that this new function’s behavior is different and what it does (on every render) is call the cleanup function unsubscribe. The pitfall is in how we tell React to render the JSX.