You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,8 @@ The **`<Router />`** object used to initialize the navigation can take the follo
100
100
-`firstRoute` (required): A React class corresponding to the first page of your navigation
101
101
-`headerStyle`: Apply a StyleSheet to the navigation bar. You'll probably want to change the backgroundColor for example.
102
102
-`titleStyle`: Apply a StyleSheet to the navigation bar titles. Useful for changing the font or text color.
103
+
-`bgStyle` Apply a StyleSheet to the background of all routes.
104
+
-`statusBarColor`: Specify the string `black` if you want the statusbar to be dark in color, or leave unspecified for a `light-content` style. Refer to StatusBarIOS for details.
103
105
-`borderBottomWidth`: Apply a bottom border to your navbar.
104
106
-`borderColor`: Apply a border color to your bottom border.
105
107
-`backButtonComponent`: By default, the navigation bar will display a simple "Back" text for the back button. To change this, you can specify your own backButton component (like in the Twitter app).
@@ -108,6 +110,7 @@ The **`<Router />`** object used to initialize the navigation can take the follo
108
110
-`hideNavigationBar`: Hide the navigation bar, always
109
111
-`handleBackAndroid` (Boolean value): Apply a listener to the native back button on Android. On click, it will go to the previous route until it reach the first scene, then it will exit the app.
110
112
113
+
111
114
The **`this.props.toRoute()`** callback prop takes one parameter (a JavaScript object) which can have the following keys:
112
115
-`name`: The name of your route, which will be shown as the title of the navigation bar unless it is changed.
113
116
-`component` (required): The React class corresponding to the view you want to render.
@@ -145,13 +148,26 @@ The functions **`this.props.setRightProps`**, **`this.props.setLeftProps`** and
145
148
- This allows you to talk directly to your navbar, because previously you could only talk to it when navigating forward or backward.
146
149
147
150
148
-
Events emitted by the router:
149
-
`didFocus`, emits route name
150
-
You can add a listener to a component as such:
151
+
As of 0.7.0 the router acts as a relay for events emitted by the navigator, and extends these to the following list:
152
+
153
+
`willFocus`: Emitted when a route will focus. Emits the route name as a string.
154
+
`didFocus`: Emitted when a route did focus. Emits the route name as a string.
155
+
`willPop`: Emitted when a route stack will be popped. Triggered by `Navigator.pop();`
156
+
`didPop`: Emitted when a route stack did pop. Triggered by `Navigator.pop();`
157
+
`willPush`: Emitted when a new route will be pushed to the route stack. Emits the new route object. Triggered by `Navigator.push(route);`
158
+
`didPush`: Emitted when a new route has been pushed to the route stack. Emits the new route object. Triggered by `Navigator.push(route);`
159
+
`willResetTo`: Emitted when the route stack will be reset to a given route. Emits the route object. Triggered by `Navigator.resetTo(route);`
160
+
`didResetTo`: Emitted when the route stack has been reset to a given route. Emits the route object. Triggered by `Navigator.resetTo(route);`
161
+
`willReplace`: Emitted when a route will replace the current one in the route stack. Emits the new route object. Triggered by `Navigator.reset(route);`
162
+
`didReplace`: Emitted when a route has replaced the current one in the route stack. Emits the new route object. Triggered by `Navigator.reset(route);`
163
+
`willPopToTop`: Emitted when the route stack will be popped to the top. Triggered by `Navigator.popToTop();`
164
+
`didPopToTop`: Emitted when the route stack has been popped to the top. Triggered by `Navigator.popToTop();`
165
+
166
+
You can listen to these events by adding an event listener as such:
0 commit comments