'jumpTo' vs 'navigate' in React (Native) Navigation

Viewed 879

Using React Navigation, different types of Navigators have different actions for (programmatically) navigating between screens.

For e.g. the StackNavigator, the 'pop', 'push' etc. have well-documented (different) behavior, compared to the common 'navigate' action.

But for the Drawer and TabNavigators, we have the option to use 'jumpTo'. I fail to understand how 'jumpTo' is different from 'navigate', and when to use what?

Documentation just says

The jumpTo action can be used to jump to an existing route in the drawer navigator.

What benefit does that have compared to 'navigate', which

...allows to navigate to a specific route

So more specifically, using a DrawerNavigation, how does this

props.navigation.navigate('Create meeting')

... work differently from this

props.navigation.jumpTo('Create meeting');

... and when should I use which?

0 Answers
Related