Skip to content

Commit

Permalink
[changed] README to make use of activeRoute clearer in JSX.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjohnson committed Jul 18, 2014
1 parent 2d0fb47 commit 8d30552
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ React.renderComponent((

When a `Route` is active, you'll get an instance of `handler`
automatically rendered for you. When one of the child routes is active,
you can render it with `this.props.activeRoute()` in the parent all the
way down the view hierarchy. This allows you to create nested layouts
the component will be available as `this.props.activeRoute` in the parent
all the way down the view hierarchy. This allows you to create nested layouts
without having to wire it all up yourself. `Link` components create
accessible anchor tags to route you around the application.

Expand Down Expand Up @@ -91,7 +91,7 @@ var App = React.createClass({
<li><Link to="users">Users</Link></li>
<li><Link to="user" userId="123">User 123</Link></li>
</ul>
{this.props.activeRoute()}
<this.props.activeRoute/>
</div>
);
}
Expand All @@ -108,7 +108,7 @@ var Users = React.createClass({
return (
<div>
<h2>Users</h2>
{this.props.activeRoute()}
<this.props.activeRoute/>
</div>
);
}
Expand Down Expand Up @@ -179,8 +179,10 @@ routes do not inherit the path of their parent.
#### Children

Routes can be nested. When a child route matches, the parent route's
handler will have an instance of the child route's handler available on
`this.props.activeRoute()`.
handler will have an instance of the child route's handler available as
`this.props.activeRoute`. You can then render it in the parent
passing in any additional props as needed.

#### Examples

```xml
Expand Down Expand Up @@ -213,9 +215,8 @@ props and static methods available to these components.

#### Props

**this.props.activeRoute** - The active child route handler instance.
Use it in your render method to render the child route. You can pass
additional props to it for rendering.
**this.props.activeRoute** - The active child route handler.
Use it in your render method to render the child route.

**this.props.params** - When a route has dynamic segments like `<Route
path="users/:userId"/>` the dynamic values are available at
Expand Down

0 comments on commit 8d30552

Please sign in to comment.