12 import { default as Router, Route } from 'react-router'
16 <Route path='*' handler={RootView} />
20 Router.run(routes, Router.HashLocation, (Root) => {
21 React.render(<Root />, document.getElementById('all'))
29 <Route handler={Chrome}>
30 <Route path='about' handler={About} />
31 <Route path='inbox' handler={Inbox} />
32 <Route path='messages/:id' handler={Message} />
36 import { RouteHandler } from 'react-router'
38 const Chrome = React.createClass({
53 var Message = React.createClass({
54 componentDidMount: function () {
55 // from the path `/inbox/messages/:id`
56 var id = this.props.params.id
63 import { Link } from 'react-router'
65 <!-- make a named route `user` -->
66 <Link to='user' params={{userId: 10}} />
69 activeClassName='-active'
78 <DefaultRoute handler={Home} />
79 <NotFoundRoute handler={NotFound} />
81 <Redirect from='login' to='sessions/new' />
82 <Redirect from='login' to='sessions/new' params={{from: 'home'}} />
83 <Redirect from='profile/:id' to='about-user' />
85 <Route name='about-user' ... />
91 var router = Router.create({
92 routes: <Route>...</Route>,
93 location: Router.HistoryLocation
96 router.run((Root) => { ... })
102 import { Navigation } from 'react-router'
105 mixins: [ Navigation ], ...
109 .transitionTo('user', {id: 10})
110 .transitionTo('/path')
111 .transitionTo('http://...')
112 .replaceWith('about')
113 .makePath('about') // return URL
114 .makeHref('about') // return URL