Skip to content

Commit f930987

Browse files
committed
Add popToRoute to the documentation
1 parent efda803 commit f930987

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ The **`this.props.resetToRoute`** function takes in an object that can contain t
179179
that you're on with the new route that you pass it, and empties the navigation stack as well.
180180
- This is useful for going to an application after a login or signup screens. If you don't want your user to be able to navigate back to it, then use `resetToRoute()` rather than `replaceRoute()`.
181181

182+
The **`this.props.popToRoute`** function takes in an object that can contain the same keys as `toRoute()`. The difference is that instead of adding a route to your stack, it pop all routes until the desired one.
183+
182184
The functions **`this.props.setRightProps`**, **`this.props.setLeftProps`** and **`this.props.setTitleProps`** take in an object of props and sends that to your navbar's `RightComponent`, `LeftComponent` or `TitleComponent`, respectively.
183185
- This allows you to talk directly to your navbar, because previously you could only talk to it when navigating forward or backward.
184186

@@ -197,6 +199,8 @@ As of 0.7.0 the router acts as a relay for events emitted by the navigator, and
197199
- `didReplace`: Emitted when a route has replaced the current one in the route stack. Emits the new route object. Triggered by `Navigator.reset(route);`
198200
- `willPopToTop`: Emitted when the route stack will be popped to the top. Triggered by `Navigator.popToTop();`
199201
- `didPopToTop`: Emitted when the route stack has been popped to the top. Triggered by `Navigator.popToTop();`
202+
- `willPopToRoute`: Emitted when the route stack will be popped to the route. Triggered by `Navigator.popToRoute(route);`
203+
- `didPopToRoute`: Emitted when the route stack has been popped to the route. Triggered by `Navigator.popToRoute(route);`
200204

201205
You can listen to these events by adding an event listener as such:
202206

@@ -213,6 +217,7 @@ As of v0.8.0 the `leftCorner`, `rightCorner` and `titleComponent` have access to
213217
- `replaceRoute(route)`
214218
- `resetToRoute(route)`
215219
- `goToFirstRoute()`
220+
- `popToRoute(route)`
216221

217222
Examples
218223
------------------------------------

0 commit comments

Comments
 (0)