Adds a new state persistence mechanisms to all of the navigators via createNavigationContainer
There are two new props that you can provide to a navigation container: `storageKey` and `renderLoading`.
`storageKey` is the string key to be used with AsyncStorage while saving and persisting navigation state. To disable persistence, set to null.
`renderLoading` allows you to render something while the navigator re-hydrates its state and loads its initial URL. By default this returns null, but Expo users will want to render a <AppLoading /> component for smooth app launches
There is also functionality in this PR to observe errors that come from re-hydrating state, and gracefully recover by dispatching an init action.
Also this revises the init action to *reset* the navigation state, rather than preserve the previous state.
* Added possibility to provide custom header back button's image, introduced API changes: removed old prop "headerBackImage", added new prop "backImage".
* Code style fixes.
* Renamed showcase file to for more clarity; updated the prop's name as well.
* Removed listeners code from showcase screens.
* wip
* fix imports
* use stylesheet for margin
stylesheet now correct
* also remove old headerLeft
* improve header buttons color
* remove ios button margin
* Add dismiss action, made possible by getParentState
* Add dismiss to flow interface
* Don't dispatch an action on dismiss helper if no parent state
* carefullyGetParent instead of getParentState
* Lazy initialization of tabs and move contents off-screen when not active
* Make subview clipping and lazy both configurable
* Record snapshots again
* Update type definition
* Remove unused log
Previously the state was getting squashed, in this case it would destroy the routeName of the state, which was a route for the parent navigator, who could no longer render properly.
* Add Flow libdef
* Move libdef to flow folder in root
* Update libdef with some refinements discovered while writing test
Mostly refining navigator config types. In the past when we tried it we got in-repo Flow errors. With a libdef we can now assert it as true!
* Get rid of all imports in libdef and refine some types
In order to make sure that contributors don't making breaking changes to our Flow types without corresponding updates to the libdefs, we should make sure these breaking changes get caught by CI. Right now our libdefs are any-typed, but I'll put up a PR later that will refine the libdef (located at `flow-typed/npm/react-navigation_vx.x.x.js`).
* Fix SimpleTabs types
dca37627a243b191fda5856aa6ce9eb1ee4957cf broke the types, but it wasn't noticed because Flow wasn't in the CI. This fixes the types; separate PR coming to add Flow to the CI.
* Refine type of NavigationEventListener callback
Instead of typing the callback as `Function`, we're now using the precise type provided by @ericvicenti
* NavigationEventListener -> NavigationEventSubscription