React-native-router-flux: popTo hangs

Created on 14 Aug 2017  Â·  15Comments  Â·  Source: aksonov/react-native-router-flux

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

Most helpful comment

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

All 15 comments

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.

I was also able to reproduce the situation in which the app is hanging for me. Here is a branch with the example app:
https://github.com/compojoom/react-native-router-flux/commit/4c02194051826bda64247815244c70393a4406d4

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.

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

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.

@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...

Maybe it happens because A is wrapped internally (if tab is not stack), so A is stack container. Try add underscore prefix to refer inner original component, i.e. ‘_A’

On 15 Aug 2017, at 18:32, Daniel Dimitrov notifications@github.com wrote:

@aksonov https://github.com/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...

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/aksonov/react-native-router-flux/issues/2234#issuecomment-322518465, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQpcSzwBV5igAF6zYjVHEpxfHSKDf-Nks5sYcgxgaJpZM4O23tN.

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

to the key.

  <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.

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.

hä???

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

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

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maphongba008 picture maphongba008  Â·  3Comments

rafaelcorreiapoli picture rafaelcorreiapoli  Â·  3Comments

kirankalyan5 picture kirankalyan5  Â·  3Comments

booboothefool picture booboothefool  Â·  3Comments

VictorK1902 picture VictorK1902  Â·  3Comments