I am using Redux and React Navigation in my app where I am making some API calls, I have a question that after successful completion of my redux cycle which lifecycle method of react component I should have to use for navigation to the next screen and why?
- The user has clicked on the login after putting his credentials on Login Screen.
- Executed the login redux action and returned a success
- After success, my Login screen props get changed and I want to redirect to the next screen.
- In which method I should have to put the navigation code like
this.props.navigation.navigate("DashoardScreen');
When I have gone through the different searches and I found that componentDidUpdate()
or shouldComponentUpdate()
will be the right method to execute this stuff.
Which method should actually I have to consider and why?