How to change the direction of the animation in StackNavigator?
When user goes to another screen, the screen flies from bottom to top.
When user goes to another screen, the screen flies from right to left. (Like Facebook or Instagram!)
export default StackNavigator ({
Main: {
screen: MainScreen,
},
...
}, {
navigationOptions: ({navigation, screenProps}) => ({
tabBarOnPress: blahblaj
}),
lazy: true
// I guess we can do something here
});
Thanks in advance,
For react navigation 5.0 something like this seems to work:
import {
CardStyleInterpolators,
createStackNavigator,
} from '@react-navigation/stack';
const Stack = createStackNavigator();
export default () => (
<Stack.Navigator
screenOptions={{
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS
}}
>
<Stack.Screen name="Screen 1" component={ScreenComponent1} />
<Stack.Screen name="Screen 2" component={ScreenComponent2} />
</Stack.Navigator>
);
More info here: https://reactnavigation.org/docs/stack-navigator/#pre-made-configs