2

I'm using the react-navigation to do the navigation part in the My App. But got some problem when trying to fulfill this function:

Now I got some screens in stack of StackNavigator:

[Main]

[Login]

[Wizard A]

[Wizard B]

After user finish the job at [Wizard B] page, the App should navigate to [Welcome] page and the previous pages should be unmounted.

I've tried to do this at my [Wizard B] container:

ownProps.navigation.dispatch(NavigationActions.reset({
    index: 0,
    actions: [
      NavigationActions.navigate({ routeName: 'Welcome', params: {...} }),
    ],
  }));

But it seems that the previous pages are not unmounted. Can anyone share any walkaround to force to unmount the page in the stack? Thanks a lot.

2
  • The ugly walkaround is pop all other screens out of stack and push [Welcome].... Commented Jan 4, 2018 at 10:17
  • the answer here - stackoverflow.com/questions/50086021/… might help Commented Mar 14, 2019 at 4:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.