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

popTo hangs #2234

Closed
compojoom opened this issue Aug 14, 2017 · 15 comments
Closed

popTo hangs #2234

compojoom opened this issue Aug 14, 2017 · 15 comments

Comments

@compojoom
Copy link
Contributor

I was trying to figure out why my app was hanging when I use popTo('sceneName'). I launched the Example with the following version:
"react-native-router-flux": "github:aksonov/react-native-router-flux#c248109ec19576dcdf24b9593d6f9542d9e59608", (beta 18)
and I was able to reproduce the issue there as well. Navigate to the last login screen (login 3) and then press "to login"

I don't see any high CPU usage or memory leak, but the app is totally unresponsive afterwards. You can't press anything and it doesn't go to the login scene.

I'm experiencing the same behavior in my app with beta17

@compojoom
Copy link
Contributor Author

Actually that seems to be a bug in the demo. You are missing key="loginModal" on the login scene. After adding it there it seems to works properly.

@compojoom
Copy link
Contributor Author

I was also able to reproduce the situation in which the app is hanging for me. Here is a branch with the example app:
compojoom@4c02194

To reproduce press the register button in the tabbar and then press the tabbar1 button.

For some reason navigating to a new scene and then trying to go back to the tabbar scene causes this.

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017

Sorry, but tab1 is not accessible from register page (i.e. by using pop), right?

@compojoom
Copy link
Contributor Author

Sorry, for the stupid question but why? How can I go back by specifying the scene I want to go to?

We can do a Actions.tab1(), then why can't we do Actions.popTo('tab1')? Actions.pop() works, but there are situations where one need to be specific as we don't know how many screens we have visited before tab1.

@compojoom
Copy link
Contributor Author

@aksonov - here is my use case
A -> B -> C

C is an edit screen that has a delete option. If I use delete I can't pop to scene B as the object it was showing previously is no longer existing. That's why I want to popTo('A'), but since A is a tab RNRF hangs.

If I popTo something that is before scene A, that is not a tab - then it works... Do I need to structure my project differently? The scenes I'm sending the user from the tab are not tabs on their own... They have their own navigation etc...

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017 via email

@compojoom
Copy link
Contributor Author

Where do I add the underscore? to the key or where?

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017

to the key.

@compojoom
Copy link
Contributor Author

  <Tabs key="tabbar" gestureEnabled={false} showLabel={false} tabs tabBarStyle={styles.tabBarStyle} activeBackgroundColor="#ddd">
                <Stack
                  key="_tab1"
                  title="Tab #1"
                  tabBarLabel="TAB #1"
                  icon={TabIcon}
                  navigationBarStyle={{ backgroundColor: 'green' }}
                  titleStyle={{ color: 'white', alignSelf: 'center' }}
                >

like that? and then Actions.popTo('_tab1')? That doesn't work.

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017

No. Tabs are wrapped automatically, so you don't need to define key with underscore. Anyway, it is not your use case. popTo(name) works in pretty simple way - just do pop until current scene will be not name . After first pop current scene will be tab2_1 (popTo('tab2_1') works). After that you have to 'navigate' not to 'pop' to switch to tab1. Closing this ticket.

@aksonov aksonov closed this as completed Aug 15, 2017
@compojoom
Copy link
Contributor Author

compojoom commented Aug 15, 2017

hä???

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017

Nice. Thanks. Login popTo works as expected, without any hanging for latest master, so your issue was invalid.

@compojoom
Copy link
Contributor Author

:) I didn't understand what you mean, but I'll try to bang my head a little more...

@aksonov
Copy link
Owner

aksonov commented Aug 15, 2017

Probably I have to wait for a week or two before answering like react-navigation team does and not try to help everybody with their problems.

@kamranyounis12
Copy link

I'm suffering from same issue with RNRF 4.0.0-beta.27

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

3 participants