-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
View not responding after custom getStateForAction #2495
Comments
Could you put together a small demo of this issue? Thanks! |
Thank you for your help. Here is a minimal example, I didn't get it running with expo or something but you can just copy this file, install react-navigation and it should run:
In this minimal example it's just with two routes and a Text with an onPress which fires a console.log. Is there a way to debug this? |
@spencercarli where you able to track down my issue or do you require more information? |
For anyone else who encounter this problem. I faced this issue and after spending a lot of time and searches found that, I mistakenly remove all callback listeners from EventEmitter somewhere in component's lifecycle.
Check if this is your case or not..! |
Current Behavior
I have a StackNavigator with several routes inside. I have a DrawerLayout on the left side. When I press on a link in the drawer I want to open that route and if it was already opened before I want to "switch" to this route and not doing a "goBack" nor a "Push". I want to do this because I don't want a rerender when I show a view which is already opened
I realized this with overwriting getStateForAction and check if my route is already in the stack.
This is working and it shows the route (screen) which I have selected in the Drawer. But the Screen is now not more responding to any interaction (onPress, Scroll or whatever). This happens on every device an simulator I have tested it on.
Expected Behavior
When I'm trying the "same thing" just with the goBack() function it works as it should. So my expected behavior is that my Screen is available after the my custom getStateForAction function. Here a .gif how it works with the BackButton
Is there a way to debug this? I'm stucked as soon as I cannot press on anything.
Just a guess, is react-navigation somewhere checking the length of
routes
? Because usually theindex
has the same size as theroutes
but in my case this is not true. Is this maybe a bad solution and anyone has a better case for this? I searched for cases like this on several places but it seems I'm the only one who wants to do this. Is there a better/implemented way to do this or is this just a bad behavior we should avoid?Your Environment
The text was updated successfully, but these errors were encountered: