I've set up a StackNavigator which will fire a redux action to fetch data on componentDidMount
, after navigating to another screen and going back to the previous screen, componentDidMount
is no longer firing and I'm presented with a white screen. I've tried to reset the StackNavigator using StackActions.reset
but that just leads to my other screens not mounting as well and in turn presenting an empty screen. Is there a way to force componentDidMount
after this.props.navigation.goBack()
?
Go Back Function
_goBack = () => {
this.props.navigation.goBack();
};
Navigation function to new screen
_showQuest = (questId, questTitle ) => {
this.props.navigation.navigate("Quest", {
questId,
questTitle,
});
};
Edit : Hi , I'm still stuck on this matter and was wondering if the SO Community has a solution to force componentDidMount to be called after Navigation.goBack() is called or rather how to Unmount the component after this.props.navigation.navigate is called
componentDidMount
will not be called again when you go back. – ThollecomponentDidMount
will be called the first time and after going back to the previous screen, it is no longer called. How do you forcefully unmount the screen after navigating to a new screen? – Ash Rhazaly