React Navigation's default screen navigation on Android looks strange, because it creates modals even if "swipe to left" closes the modal:
I would like the animation to slide from left to right in the same way on iOS:
The solution is very simple:
import {
createAppContainer,
createStackNavigator,
StackViewTransitionConfigs,
} from 'react-navigation'
const Navigation = createStackNavigator({
screenA: ComponentA,
screenB: ComponentB,
}, {
mode: 'card',
transitionConfig: () => StackViewTransitionConfigs.SlideFromRightIOS,
}
export const AppNavigation = createAppContainer(Navigation)
I wonder why this is the default behavior...
Top comments (3)
This works! But is there any way to implement swipe back?
Thank you for your comment.
If you set
gesturesEnabled: true
in stack navigation config swipe back will be enabled, which is the default settings.do you if for @react-navigation/bottom-tabs works?