How to disable react navigation's stack navigator transition?

Suresh Murali picture Suresh Murali · Sep 13, 2018 · Viewed 15.6k times · Source

In React Native (iOS), React navigation's stack navigator has a default transition animation to move screens left or right based on the stack order. Is there any way to disable the transition animation?

Answer

wobsoriano picture wobsoriano · Feb 15, 2020

React Navigation 5

{/* Screen level */}
<NavigationContainer>
  <Stack.Navigator>
    <Stack.Screen
      name="HomeScreen"
      component={HomeScreen}
      options={{
        animationEnabled: false,
      }}
    />
  </Stack.Navigator>
</NavigationContainer>

{/* Whole navigation stack */}
<Stack.Navigator screenOptions={{ animationEnabled: false }}></Stack.Navigator>

More options here https://reactnavigation.org/docs/stack-navigator/