Skip to content

Commit 80c72eb

Browse files
committed
Add replace to NavigationActions
1 parent 9328dbc commit 80c72eb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/navigation-actions.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The following actions are supported:
1818
Within a stack, you can also use:
1919

2020
* [Reset](#Reset) - Replace current state with a new state
21+
* [Replace](#Replace) - Replace a route at a given key with another route
2122
* [Push](#Push) - Add a route on the top of the stack, and navigate forward to it
2223
* [Pop](#Pop) - Navigate back to previous routes
2324
* [PopToTop](#PopToTop) - Navigate to the top route of the stack, dismissing all other routes
@@ -85,6 +86,17 @@ const resetAction = NavigationActions.reset({
8586
this.props.navigation.dispatch(resetAction);
8687
```
8788

89+
### Replace
90+
91+
The `Replace` action replaces the route at the given key with another route.
92+
93+
* `key` - _string - required - Key of the route to replace.
94+
* `newKey` - _string - Key to use for the replacement route. Generated automatically if not provided.
95+
* `routeName` - _string - `routeName` to use for replacement route.
96+
* `params` - _object_ - Parameters to pass in to the replacement route.
97+
* `action` - _object_ - Optional sub-action.
98+
* `immediate`* - _boolean_ - *Currently has no effect*, this is a placeholder for when `StackNavigator` supports animated replace (it currently does not).
99+
88100
### Back
89101

90102
Go back to previous screen and close current screen. `back` action creator takes in one optional parameter:

0 commit comments

Comments
 (0)