Mastering Development

When does a functional component “execute” in React Native when context changes?

I have a screen in React Native written as a functional component that uses a context containing location data, and a hook that sets the location using watchPositionAsync. const TrackCreateScreen = ({ isFocused }) => { const { addLocation } = useContext(LocationContext); const [err] = useLocation(addLocation); console.log(isFocused); return ( … ); }; When I navigate […]