I'm creating a notification reminder application in react native, I tried opening a specific screen in the application when user taps on the notification, I'm using react-navigation and tried deep linking with the screen paths. so my problem is, the deep-linked screen is opening fine when the app is foreground already, but if I open the notification when the app is closed(even not in recent), it goes to the deep-linked screen and immediately going back to the previous screen.
I'm doing some async operations in the useEffect
. not sure if this is the issue, help can be greatly appreciated.
useEffect(() => {
const paramObject = navigation.getParam('someObject', {});
if (Object.keys(paramObject).length === 0) {
const resourceID = navigation.getParam('resource_id', '');
const target = navigation.getParam('target', '');
axios.get().then(() => {
// some state setting
}).catch(); #Some api call
}
}, []);
Note: Problem occurs when the deeplink page opens when the app is closed, I'm also getting some warnings with the problem like Can't Perform react state update on a unmounted component ...