When swiping left or right, the current screen drags and reveals the adjacent screens (routes). Is this the intended behaviour? Is there a way to disable this?
Probably it is default React Native Navigator behaviour. You may disable gestures within your sceneconfig to disable it.
You were absolutely right. Thanks! Is there any official documentation regarding sceneConfigs? I tried searching but only found referrals to the source code.
I don't know any docs... Maybe you could ask React Native team about that.
Would either of you be able to provide an example of how to do this?
@blocka you could have a look at the source code.
https://github.com/facebook/react-native/blob/9a82c03e1f3415e255c5936aa2c35f0fd006a785/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js
To diasble the gestures override the SceneConfig
// ES2015
const newConfig = {...Navigator.SceneConfigs.VerticalUpSwipeJump, gestures: null};
// or
var newConfig = Object.assign({}, Navigator.SceneConfigs.VerticalUpSwipeJump, {gestures: null});
When swiping left or right, the current screen drags and reveals the adjacent screens (routes). Is this the intended behaviour? Is there a way to disable this?
Use " import GestureRecognizer, {swipeDirections} from 'react-native-swipe-gestures';"
Most helpful comment
Would either of you be able to provide an example of how to do this?