@@ -111,7 +111,7 @@ Let's refactor our app to use React Router.
111
111
// first we import some components
112
112
import { Router , Route , Link } from ' react-router' ;
113
113
// the histories are imported separately for smaller builds
114
- import HashHistory from ' react-router/lib/HashHistory' ;
114
+ import { history } from ' react-router/lib/HashHistory' ;
115
115
116
116
// ...
117
117
@@ -141,7 +141,7 @@ var App = React.createClass({
141
141
// Finally we render a `Router` component with some `Route`s, it'll do all
142
142
// the fancy routing stuff for us.
143
143
React .render ((
144
- < Router history= {new HashHistory }>
144
+ < Router history= {history }>
145
145
< Route path= " /" component= {App}>
146
146
< Route path= " about" component= {About}/ >
147
147
< Route path= " inbox" component= {Inbox}/ >
@@ -162,7 +162,7 @@ var routes = {
162
162
]
163
163
};
164
164
165
- React .render (< Router history= {new HashHistory } children= {routes}/ > , document .body );
165
+ React .render (< Router history= {history } children= {routes}/ > , document .body );
166
166
```
167
167
168
168
Adding more UI
@@ -191,7 +191,7 @@ var Inbox = React.createClass({
191
191
});
192
192
193
193
React .render ((
194
- < Router history= {new HashHistory }>
194
+ < Router history= {history }>
195
195
< Route component= {App}>
196
196
< Route path= " about" component= {About}/ >
197
197
< Route path= " inbox" component= {Inbox}>
@@ -230,4 +230,3 @@ var Message = React.createClass({
230
230
That's the gist of React Router. Application UIs are boxes inside of
231
231
boxes inside of boxes; now you can keep those boxes in sync with the
232
232
URL.
233
-
0 commit comments