mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-06 17:34:59 +08:00
Elaborate on how to use the reset action in docs (#213)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user