Add onNavigationStateChange (#453)

* Support

* Revert consoleg

* Add very bad doc

* Improve docs

* Surpress flow
This commit is contained in:
Mike Grabowski
2017-02-24 07:18:06 +01:00
committed by Eric Vicenti
parent 71e8c95b34
commit 26b165200f
3 changed files with 65 additions and 12 deletions

View File

@@ -48,10 +48,14 @@ When rendering one of the included navigators, the navigation prop is optional.
For the purpose of convenience, the built-in navigators have this ability because behind the scenes they use `createNavigationContainer`. Usually, navigators require a navigation prop in order to function.
### `onNavigationStateChange(prevState, newState)`
Sometimes it is useful to know when navigation state managed by the top-level navigator changes. For this purpose, this function gets called every time with the previous state and the new state of the navigation.
### `containerOptions`
These options can be used to configure a navigator when it is used at the top level.
An error will be thrown if a navigator is configured with `containerOptions` and also receives a `navigation` prop, because in that case it would be unclear if the navigator should handle its own state.
- `URIPrefix` - The prefix of the URIs that the app might handle. This will be used when handling a [deep link](/docs/guides/linking) to extract the path passed to the router.
- `URIPrefix` - The prefix of the URIs that the app might handle. This will be used when handling a [deep link](/docs/guides/linking) to extract the path passed to the router.