1

How can you navigate to a different stack's child navigator without animation or delay using react-navigation/native@^6.0.13?

enter image description here

I'm able to navigate from CreateOrderScreen to OrderScreen but because the OrderNavigator is a child of HomeNavigator there's a delay in the navigation. Currently when you navigate, you first land on the HomeScreen and after that you are navigated, (with animation), to the OrderScreen. I do not wish to see HomeScreen at all, I want to go straight to OrderScreen.

navigation.navigate('Root', {
  screen: 'Home',
  params: {
    screen: 'Order',
    params: {
      screen: 'OrderScreen',
      params: {
        id: 213090,
        title: `test`,
        state: OrderState.Confirmed,
      },
    },
  },
})

What I've tried:

  • Removing animation on the StackNavigators, (did not help, animation was skipped but still delay, you still see HomeScreen)
  • Replace/push without success

One interesting sidenote is that if OrderScreen is already mounted when navigating, (while CreateOrderScreen is active), no delay or animation is shown and everything works as intended.

Reft
  • 2,333
  • 5
  • 36
  • 64

0 Answers0