Skip to content

Commit d83f25d

Browse files
Merge pull request #37 from sethx/patch-9
Update README.md
2 parents f5a92b6 + c331057 commit d83f25d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ The **`<Router \>`** object used to initialize the navigation can take the follo
8989
- `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).
9090
- `rightCorner`: If you have the same occuring action buttons on the right side of your navigation bar (like the Twitter "Compose"-button), you can specify a component for that view.
9191
- `customAction`: A special callback prop for your action buttons (this can be handy for triggering a side menu for example). The action gets triggered from your custom `leftCorner` or `rightCorner` components by calling `this.props.customAction("someActionName")` from them. It is then picked up like this: `<Router customAction={this.doSomething} />`.
92+
- `hideNavigationBar`: Hide the navigation bar, always
9293

9394
The **`this.props.toRoute()`** callback prop takes one parameter (a JavaScript object) which can have the following keys:
9495
- `name`: The name of your route, which will be shown as the title of the navigation bar unless it is changed.
@@ -98,7 +99,8 @@ The **`this.props.toRoute()`** callback prop takes one parameter (a JavaScript o
9899
- `titleComponent`: Specify a component to replace the title. This could for example be your logo (as in the first page of the Instagram app)
99100
- `headerStyle`: Change the style of your header for the new route. You could for example specify a new backgroundColor and the router will automatically make a nice transition from one color to the other!
100101
- `passProps`: Takes in an object. Passes each `key: value` pair to your component as a prop. i.e. <Component key={value} />
101-
- `trans`: If you set trans to `true` it will make the navbar transparent and move your component content so that it sits behind the nav.
102+
- `trans`: If set to a truthy value it will make the navbar transparent and move your component content so that it sits behind the nav.
103+
- `hideNavigationBar`: If set to a truthy value will hide the navigationbar out of view, and move the component so that it is at the top of the screen.
102104
- `leftCornerProps`: If you set a `leftCorner` component you can use this property to pass props to that component.
103105
- `rightCornerProps`: If you set a `rightCorner` component you can use this property to pass props to that component.
104106
- `sceneConfig`: Control the animation of the route being switched. Possible values are:
@@ -124,6 +126,18 @@ The **`this.props.setRightProps`** and **`this.props.setLeftProps`** take in an
124126
- This allows you to talk directly to your navbar, because previously you could only talk to it when navigating forward or backward.
125127

126128

129+
Events emitted by the router:
130+
`didFocus`, emits route name
131+
You can add a listener to a component as such:
132+
133+
```javascript
134+
this.props.routeEmitter.addListener('didFocus', (name) => {
135+
//Check if name is the current component, and if it is, act on this focus event.
136+
});
137+
```
138+
139+
140+
127141
A more advanced example: Twitter app
128142
------------------------------------
129143

0 commit comments

Comments
 (0)