When we double-click(or multi-click) a link quickly, it will navigate to the same screen twice, so when we want to goBack, we need click the back button twice to go back to parent screen, that's insane.
I use ExperimentalNavigation before, and if I double-click a link quickly, the app crashes because we are pushing a route with the same key, which is not allowed by ExperimentalNavigation, you can try the UIExplorer to reproduce, so I make a check for it:
- newKey == latestKey, ignore this action
- routes.contains(newKey), jumpTo(newKey)
Now in react-navigation it won't crash because every time we dispatch a new action, we get a different key
So my propose:
- don't generate key if provided in action when dispatching and check for existing
- generate key according to route params, but I'm afraid that will be buggy because the screen relies on more params expect routeParams
Any thoughts on this?
When we double-click(or multi-click) a link quickly, it will navigate to the same screen twice, so when we want to goBack, we need click the back button twice to go back to parent screen, that's insane.
I use
ExperimentalNavigationbefore, and if I double-click a link quickly, the app crashes because we are pushing a route with the same key, which is not allowed byExperimentalNavigation, you can try theUIExplorerto reproduce, so I make a check for it:Now in
react-navigationit won't crash because every time we dispatch a new action, we get a different keySo my propose:
Any thoughts on this?