Skip to content

Commit

Permalink
document route props passing to route handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Aug 1, 2014
1 parent 760f021 commit 3db323c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/api/components/Route.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,35 @@ handler will have the child route's handler available as
`this.props.activeRouteHandler`. You can then render it in the parent
passing in any additional props as needed.

### [prop]

Any additional, user-defined, properties will be become properties of
the rendered handler.

#### Example:

```js
var App;
var foo = "hello";

var routes = (
<Routes>
// pass `foo` to `something`
<Route handler={App} something={foo}/>
</Routes>
);

App = React.createClass({
render: function() {
// access `something` on props
return <div>{this.props.something}</div>
}
});

React.renderComponent(routes, document.body);
document.body.innerHTML // -> <div>hello</div>
```

Example
-------

Expand Down

0 comments on commit 3db323c

Please sign in to comment.