Issue
How can I do this:
if navigation stack is not empty
this.props.navigation.goBack()
else
this.props.navigation.navigate('CustomScreen')
Solution
a workaround solution is sending param from previous screen and in current screen check if that param exist
Screen1:
this.props.navigation.navigate('Screen2', {prevScreen: 'Screen1'});
Screen2:
if(this.props.navigation.getParam('prevScreen', null))
this.props.navigation.goBack();
else
this.props.navigation.navigate('CustomScreen');
Answered By - SiSa
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.