react-navigation-stack

How to reset a specific stack navigator from outside of it?

我怕爱的太早我们不能终老 提交于 2019-12-02 10:07:25
I'm making an app using react-navigation with react-native. The structure of my app is, Main Tab - Tab 1 (Stack) - screen A - screen B - screen C - Tab 2 (Stack) - screen D - screen E - screen F What I want to do is reset Tab 1 (Stack Navigator) at the specific time and do not navigate to Tab 1. if a user is located in screen F, I just want to reset Tab 1 (Stack) without letting the user move to Tab 1. So I think dispatching navigation actions should be triggered outside of these react components, somewhere like resetHelper.js But I can't figure out how to reset a specific stack without