Tell us which versions you are using:
I want to disable the swipe back function only from main screen to splash screen.
And when it comes to other screens, I want the swipe back function to work.
I have tried to add gestureEnabled / panHandlers to the parent Scene, but it will disable all the swipe back function.
What I expect is to only disable the swipe back function to spash screen.
<Router>
<Scene hideNavBar={true}>
<Scene key="splashScreen" component={splashScreen} initial />
<Scene key="mainScreen" title="main" hideNavBar={true} >
<Scene key="main1" component={main1} />
<Scene key="main2" component={main2} />
</Scene>
</Scene>
</Router>
I want to disable swipe back between splashScreen and main1/main2 ,
and enable swipe back between main1 and main2.
Only way to do this is using the panHandlers={null} prop. You can _switch up how your scenes are nested_ or only _specify that prop on certain scenes_ to ensure the rest of your application still has the expected swipe back behavior.
I agree with @LeviWilliams - I believe Splashscreen should not be part of your group of scenes - but a piece of Switch - to be replaced when finish loading - that way there is no back to splash when the app loads - since the scene would be removed from the stack.
Or try to use a type replace - that way it will be also replaced instead of having other scene pushed over.
Let's move this discussion to StackOverflow or the gitter channel - since it suits more there than here. In case if you think this is a bug and need to be really fixed, reopen the issue.
Most helpful comment
I agree with @LeviWilliams - I believe Splashscreen should not be part of your group of scenes - but a piece of
Switch- to be replaced when finish loading - that way there is no back to splash when the app loads - since the scene would be removed from the stack.Or try to use a type
replace- that way it will be also replaced instead of having other scene pushed over.Let's move this discussion to StackOverflow or the gitter channel - since it suits more there than here. In case if you think this is a bug and need to be really fixed, reopen the issue.