Parent Navigator
Nested navigator 1
- Screen A
- Screen B
Nested navigator 2
- Screen C
- Screen D
How can I go from Screen D to Screen B in React Navigation v5.0 ?
I tried something similar to https://reactnavigation.org/docs/en/navigation-actions.html#reset
but when I try to use CommonActions.reset(), it navigates to Screen C
I tried this;
...
import { CommonActions } from '@react-navigation/native';
...
navigation.dispatch(
CommonActions.reset({
index: 1,
routes: [
{ name: 'ScreenB' },
],
})
);
..
index:0?