Skip to content

Commit

Permalink
feat(demo16): update react-router of demo16 to v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed May 17, 2016
1 parent da87bd6 commit bbfeb2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions demo16/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<html>
<body>
<div id="app"></div>
<script src="/bundle.js"></script>
</body>
</htmL>
9 changes: 3 additions & 6 deletions demo16/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, Link, IndexRoute } from 'react-router';
import createBrowserHistory from 'history/lib/createBrowserHistory';
import { Router, Route, Link, IndexRoute, browserHistory } from 'react-router';

require('./app.css');

Expand Down Expand Up @@ -53,10 +52,8 @@ var Calendar = React.createClass({
}
});

let history = createBrowserHistory();

render((
<Router history={history}>
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Dashboard}/>
<Route path="app" component={Dashboard}/>
Expand All @@ -65,4 +62,4 @@ render((
<Route path="*" component={Dashboard}/>
</Route>
</Router>
), document.body);
), document.querySelector('#app'));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"open-browser-webpack-plugin": "0.0.1",
"react": "~0.14.2",
"react-dom": "~0.14.2",
"react-router": "^1.0.3",
"react-router": "2.x",
"style-loader": "~0.12.3",
"url-loader": "~0.5.6",
"webpack": "~1.11.0",
Expand Down

0 comments on commit bbfeb2d

Please sign in to comment.