UNPKG

react-router

Version:

A complete routing library for React.js

85 lines (67 loc) 1.48 kB
Upgrade Guide ============= To see discussion around these API changes, please refer to the [CHANGELOG](/CHANGELOG) and git log the commits to find the issues they refer to. 0.4.x -> 0.5.x -------------- We brought back `<Routes/>`. ```js // 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> ); ``` 0.3.x -> 0.4.x -------------- NPM users should point their apps to `react-router` instead of `react-nested-router`. Make sure to `npm prune`! 0.2.x -> 0.3.x -------------- - React `0.11.x` is now required. - `this.props.activeRoute` became `this.props.activeRouteHandler()` ```js // 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> ); } }); ``` 0.1.x -> 0.2.x -------------- The `Router` function was removed. ```js // 0.1.x var router = Router(routes); router.renderComponent(element); // 0.2.x React.renderComponent(routes, element); ```