Elaborate on how to use the reset action in docs (#213)

This commit is contained in:
Mark Florisson
2017-02-07 16:38:54 +00:00
parent d79a1649c0
commit bc7eff23ce

View File

@@ -139,6 +139,22 @@ this.props.navigation.dispatch(resetAction)
```
You can issue multiple actions, but make sure to set `index` correctly:
```js
import { NavigationActions } from 'react-navigation'
const resetAction = NavigationActions.reset({
index: 1,
actions: [
NavigationActions.navigate({ routeName: 'Profile'}),
NavigationActions.navigate({ routeName: 'Settings'})
]
})
this.props.navigation.dispatch(resetAction)
```
### SetParams
When dispatching `SetParams`, the router will produce a new state that has changed the params of a particular route, as identified by the key