warning error: can't perform a react state update on an unmounted component.
This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and synchrounous taks in a useEffect cleanup function.
I was using it to navigate to different scenes once the location had been captured. But it's shown up the warning after it's navigate to the screen
useEffect ( () => { (async () => { let {status} = await Location.requestPermissionsAsync(); if (status !== 'granted'){ setErrorMsg('Permission to access location is not granted') } let location = await Location.getCurrentPositionAsync({}); const {coords} = location if (coords) { const {latitude, longitude} = coords; let addressResponse: any = await Location.reverseGeocodeAsync({latitude, longitude}) for (let item of addressResponse){ setAddress(item) let currentAddress = `${item.name},${item.street},${item.postalCode},${item.country}` setDisplayAddress (currentAddress) if (currentAddress.length>0){ setTimeout( () => { navigate('homeStack') },1000) } return; } }else { } })();},)