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

header onBack bug? #2146

Closed
stulip opened this issue Jul 31, 2017 · 8 comments
Closed

header onBack bug? #2146

stulip opened this issue Jul 31, 2017 · 8 comments

Comments

@stulip
Copy link

stulip commented Jul 31, 2017

export default props => ( <Scene key="root" hideNavBar> <Scene key="home" tabs initial={props.initKey === 'home'} tabBarComponent={TabBarBottom} > <Scene tabBarIcon={welcomeIcon} key="homeWelcome" tabBarLabel="Welcome" component={Welcome} title="React Native"/> <Scene tabBarIcon={homeIcon} key="homeIndex" title="home" tabBarLabel="home" component={HomeScene}/> <Scene tabBarIcon={imIcon} key="homeIm" title="im" tabBarLabel="im" component={ImScene}/> <Scene tabBarIcon={meIcon} key="homeMe" title="me" tabBarLabel="me" component={MeScene}/> </Scene> <Scene key="sub" hideTabBar initial={props.initKey === 'subLogin'} headerStyle={styles.headerStyle} headerTitleStyle={styles.headerTitleStyle} tintColor={mainColors.sub.headerTitleColor} > <Scene key="subLogin" component={Login} hideNavBar/> <Scene key="subIOS" component={IOS} title="iOS" /> <Scene key="subAndroid" component={Android} title="Android"/> </Scene> </Scene> )

I am using the Actions.push ("subAndroid") on the tabs welcome page;
And then click on the subAndroid page header return button, the results are not welcome page welcome page
But the Login page
Is my configuration problem, or bug?

@aksonov
Copy link
Owner

aksonov commented Jul 31, 2017

Please try to reproduce on Example project and give me a link.

@stulip
Copy link
Author

stulip commented Jul 31, 2017

I am in China, do you look at this git address (https://git.oschina.net/stulip/react-native-template) Can you visit?

Project catalog
Adb install build / android / iyimu-main-debug-0.1.17.apk
Yarn && yarn start

Home click Android or iOS text.

@aksonov
Copy link
Owner

aksonov commented Jul 31, 2017

Do you see the bug on iOS? I don't have android sdk.

@stulip
Copy link
Author

stulip commented Jul 31, 2017

There is also this problem.
If you can access my project git. After you update git can run on ios above
Script: react-native run-ios

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017

I can't help here, I could work only with modified Example from this repository, not your projects.

@stulip
Copy link
Author

stulip commented Aug 1, 2017

Yes, I changed your example:
add code in TabView.js
<Button onPress={Actions.home}>home</Button>
You can reproduce the problem.
Should be Action.pop bug

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017

Home is used to demonstrate 'pop and push' action - it cannot be used for initial scenes like TabView.

@aksonov
Copy link
Owner

aksonov commented Aug 1, 2017

It is definitely configuration problem - you are calling screens from another navigation tree - so you will be switched to that tree (it is standard behaviour determined by react-navigation), so back action will return you to parent tree, not your screen. You could try to use clone scenes so they will be pushed from your current nav tree.

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

No branches or pull requests

2 participants