mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
b5c1cd7918
Summary: A minor improvement suggestion: `Navigator.getCurrentRoutes()` probably shouldn't return its `routeStack` backing array as-is, because the caller may mutate it, causing the internal state of the navigator to go out of sync. Instead a shallow copy of the routes should be returned. I stumbled on this problem in my app by attempting to read the navigator state as follows: ``` let routes = Navigator.getCurrentRoutes(); let current = routes.pop(); let previous = routes.pop(); ``` Which led to an exception at next navigation event. CLA signed. Closes https://github.com/facebook/react-native/pull/1888 Github Author: Jani Evakallio <jani.evakallio@gmail.com>