Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

physical back on Android works weird after executing Linking.openURL #3057

Closed
junchenjun opened this issue May 28, 2018 · 2 comments
Closed

Comments

@junchenjun
Copy link

junchenjun commented May 28, 2018

Version

Tell us which versions you are using:

react-native-router-flux v4.0.0
react-native v0.55.4

Expected behaviour

back to previous scene

Actual behaviour

send me to the initial scene

Steps to reproduce

  1. open a link using Linking.openURL ( inside About scene ) and send me to the browser
  2. come back to the app from the browser
  3. press physical backbutton on Android
  4. send me to the initial scene( do not call componentWillUnmount, do not call BackHandler )
  5. I can strangely swipe back from my initial scene back to the About scene.
  6. press physical backbutton again back to previous scene like normal( finally call componentWillUnmount)

This is just so weird, everything works fine without calling openURL, and I did this in another component, works fine too, but in this component it doesn't.

I don't understand why it just send me to the initial screen without calling componentWillUnmount or BackHandler, and everything works perfect using swipe back gesture and directly calling Action.pop() works perfect too.

This issue happens inside my About component, both on my SM S6 and Android simulator.

<Router>
<Stack 
	key="root" 
	hideNavBar 
	hideTabBar
>
		<Drawer 
			key={ 'Drawer' } 
			drawer={ true } 
			contentComponent={ Drawer } 
			drawerWidth={ width*0.7 } 
			drawerPosition={ 'left' }
			tapToClose={ true }
		>
			<Scene 
				key="Feeds" 
				component={ Feeds } 
				hideNavBar 
				hideTabBar 
				initial 
			/>
		</Drawer>

		<Scene key="FeedDetail" component={ FeedDetail }  />
		<Scene key="ArticleDetail" component={ ArticleDetail }  />
		<Scene key="LoginForm" component={ LoginForm } gesturesEnabled={ false } />
		<Scene key="About" component={ About } />
		<Scene key="AddFeed" component={ AddFeed } gesturesEnabled={ false } />
</Stack>
</Router>
@junchenjun junchenjun changed the title physical back on Android Action.pop() won't work after execute Linking.openURL physical back on Android works weird after executing Linking.openURL May 28, 2018
@junchenjun
Copy link
Author

One thing to note, when I put all the scenes inside the Drawer, doesn't have this issue.

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Yes, please wrap all scenes inside the Drawer.

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants