React-native-router-flux: Screens move when swiping or dragging left and right

Created on 23 Feb 2016  路  6Comments  路  Source: aksonov/react-native-router-flux

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?

question

Most helpful comment

Would either of you be able to provide an example of how to do this?

All 6 comments

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';"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moaxaca picture moaxaca  路  3Comments

tonypeng picture tonypeng  路  3Comments

GCour picture GCour  路  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments