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

Tabbed Scene Jumping Back to first tab #2164

Closed
MakeAndyBetter opened this issue Aug 2, 2017 · 7 comments
Closed

Tabbed Scene Jumping Back to first tab #2164

MakeAndyBetter opened this issue Aug 2, 2017 · 7 comments

Comments

@MakeAndyBetter
Copy link

MakeAndyBetter commented Aug 2, 2017

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.15
  • react-native v0.46.4

<Router createReducer={reducerCreate}> <Scene key="root"> <Scene key="t1" tabs title="Tabs"> <Scene key="t1_1" tabBarLabel="Tab 1" component={Tab1} navigationBarStyle={{height:0}}/> <Scene key="t2_2" tabBarLabel="Tab 2" component={Tab1} navigationBarStyle={{height:0}}/> <Scene key="t3_3" tabBarLabel="Tab 3" component={Tab1} navigationBarStyle={{height:0}}/> </Scene> </Scene> </Router>

Expected behaviour

Tabbed Navigation to stay on current tab.

Actual behaviour

When the scene is loaded I swipe to a new tab, and then after a few seconds it tabs back to the first tab automatically.

The time it takes to do this is also the same time it takes to change tab when you press on the tab bar to go to the next tab... which is quite a delay.

But after that time window it operates as expected

Steps to reproduce

  1. As soon as scene is loaded swipe to next tab
  2. Wait a few seconds
  3. Scene jumps back to first
@aksonov
Copy link
Owner

aksonov commented Aug 2, 2017

Could you check pure react-navigation TabNavigator first? It is possible that the problem is there because RNRF uses react-navigation internally.

@MakeAndyBetter
Copy link
Author

I started the project with RNRF 3.38 and it worked perfectly apart from being sluggish in debug mode. But also I've noticed that in v4 the tabs mount together where before a tab mounted on request.

@aksonov
Copy link
Owner

aksonov commented Aug 2, 2017

Use lazy prop for tabs Scene

@MakeAndyBetter
Copy link
Author

Thank you lazy helped me not rewrite some redux. Although the automatic tab back is still happening.

@aksonov
Copy link
Owner

aksonov commented Aug 3, 2017

Could you check pure react-navigation TabNavigator first? It is possible that the problem is there because RNRF uses react-navigation internally.

@MakeAndyBetter
Copy link
Author

I'll give that a try when I've got a little more time on my hands. However it does look like the issue is connected to hot-loading. I'll confirm soonest. Thanks.

@aksonov
Copy link
Owner

aksonov commented Aug 7, 2017

Closed due inactivity. Fee free to reopen if any.

@aksonov aksonov closed this as completed Aug 7, 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