Navigate to root screen from nested stack navigator

后端 未结 4 1150
迷失自我
迷失自我 2021-01-18 21:59

i am new to react and trying to learn it by myself , i am facing problem in navigating user back to root screen from nested stck navigator screen .

Here is some of m

4条回答
  •  悲哀的现实
    2021-01-18 22:20

    After trying almost everything, I've found the solution that worked for me:

      this.props.navigation.popToTop(); // go to the top of the stack
      this.props.navigation.goBack(null); // now show the root screen
    

提交回复
热议问题