There are A(from) -> B -> C -> D(to) sreens.
I wanna navigate to B from D in specific situation.
I tried to send navigation parameters B to C to D.
and submit action occurred from D, navigate to B using the navigation parameters.
But, I think it is not the best way.
Are there any better way to navigate backward?
2
Answers
import { StackActions } from ‘@react-navigation/native’;
navigation.dispatch(StackActions.replace(‘B’)
you can just use:
Then the navigation will back to B for you, or you can use this code: