React-native-router-flux: How to disable swipe to back

Created on 20 Aug 2017  路  14Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.18
  • react-native v0.47.1

Expected behaviour

swipe to back not popping the scene

Actual behaviour

Swiping to the right (standard swipe back behaviour) popping the scene with no back button

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  1. create two scenes, i.e. Auth and Main
  2. define Login sceme in Auth and Home in Main
  3. perform login action which executed Main action.
  4. swipe back from Main gets you to the Login screen.

Most helpful comment

Use gesturesEnabled={false} or panHandlers={null}

All 14 comments

Use gesturesEnabled={false} or panHandlers={null}

@aksonov thanks, is there a place for all of the props ? it seems in the example you using it in Tabs, but it would work in scene as well?

@aksonov gestureEnabled is not working but panHandlers is (using version 4.0.0-beta.21). What's the difference between those props???

@mkayswork I believe that is because gestureEnabled is a typo :)
It should be gesturesEnabled (plural)

Hi, how could I disable the virtual button to go back android, any ideas?

@iKronyck What do you mean by "virtual button" on Android ?

@iKronyck Do you mean the hardware back button? You need to implement the BackHandler

Thanks!! I'll read about that

Just curious, why is gesturesEnabled and panHandlers are not documented?

Try swipeEnabled={false}

Use gesturesEnabled={false} or panHandlers={null}

its save me, thanks u.

Try swipeEnabled={false}

its not working.

Just curious, why is gesturesEnabled and panHandlers are not documented?

++++

whenever you are moving one scene to another and you want to disable swipe for current scene.Then use Actions.replace('next-scene'); instead of Actions.push('next-scene'); or Actions.next-scene().

I resolve my problem by doing this.

Was this page helpful?
0 / 5 - 0 ratings