To see discussion around these API changes, please refer to the CHANGELOG and git log the commits to find the issues they refer to.
We brought back <Routes/>
.
// 0.4.x
var routes = (
<Route handler={App} location="history">
<Route name="about" handler="about"/>
</Route>
);
// 0.5.x
var routes = (
<Routes location="history">
<Route handler={App}>
<Route name="about" handler="about"/>
</Route>
</Routes>
);
NPM users should point their apps to react-router
instead of
react-nested-router
. Make sure to npm prune
!
- React
0.11.x
is now required. this.props.activeRoute
becamethis.props.activeRouteHandler()
// 0.2.x
var App = React.createClass({
render: function() {
return (
<div>
{this.props.activeRoute}
</div>
);
}
});
// 0.3.x
var App = React.createClass({
render: function() {
// now you can send extra props to the active route handler
// and use the new jsx syntax
// <this.props.activeRouteHandler extraProp={something}/>
return (
<div>
{this.props.activeRouteHandler()}
</div>
);
}
});
The Router
function was removed.
// 0.1.x
var router = Router(routes);
router.renderComponent(element);
// 0.2.x
React.renderComponent(routes, element);