reset navigation to specific tab react-navigation code example
Example: reset navigation to specific tab react-navigation
navigation.reset({
index: 1,
routes: [
{
name: 'Screen1',
state: {
routes: [{ name: 'Tab2' }],
},
},
{
name: 'Screen1',
state: {
routes: [
{
name: 'Tab2',
state: {
routes: [{ name: 'Screen5' }, { name: 'Screen4' }]
},
},
],
},
},
],
})