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

Always show backbutton, and exit app on back. #2366

Closed
sneerin opened this issue Sep 11, 2017 · 5 comments
Closed

Always show backbutton, and exit app on back. #2366

sneerin opened this issue Sep 11, 2017 · 5 comments

Comments

@sneerin
Copy link

sneerin commented Sep 11, 2017

Is it possible always show back button? For my case, I just need to exit react activity. But for other cases it could be a menu as well, wasn't able to find it in the documentation. please advise.
Should it be state changes, totally custom navbar?

@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 11, 2017

The back button will show only when you have a Scene to navigate back to. this is based on react-navigation. If you are looking to always have a back button to perform some sort of action, you can try the onLeft features of the Scene or indeed implement your own custom navBar.

@sneerin
Copy link
Author

sneerin commented Sep 11, 2017

I was looking here:
renderLeftButton
not sure if it works for v4, but anyway thanks for suggestion

@mcabs3
Copy link
Collaborator

mcabs3 commented Sep 11, 2017

Sure, if you need further help, let me know.

@luisfuertes
Copy link

I have that router:

			<Router sceneStyle={{backgroundColor:'white'}}>
				<Scene key='lightbox' lightbox>
					<Scene key='root'>
						<Scene key='Login' initial={true} component={Login} hideNavBar/>
						<Scene key='User' component={User} />
					</Scene>
				</Scene>
			</Router>

From Login scene i do Actions.User() and in User scene, react-native-router-flux show back button but when i press it, app crash with: _this.props.navigation.goBack is not a function instead do a simple pop

@luisfuertes
Copy link

luisfuertes commented Sep 12, 2017

If i add onLeft={(e) => console.log("e: ", e)} prop to scene, console.log isnt printed, but when i press back button do pop() correctly...

@onrige onrige closed this as completed Oct 30, 2017
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

4 participants