Posts

Showing posts with the label react-redux

componentDidMount not being called after goBack navigation call

componentDidMount not being called after goBack navigation call 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() ? componentDidMount componentDidMount StackActions.reset componentDidMount 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, }); }; How are you rendering your components? It might be...