File tree Expand file tree Collapse file tree 4 files changed +1321
-1012
lines changed Expand file tree Collapse file tree 4 files changed +1321
-1012
lines changed Original file line number Diff line number Diff line change 55## 特色
66
77* [ react] ( https://github.com/facebook/react )
8- * [ react-router 3 ] ( https://github .com/rackt/ react-router )
8+ * [ react-router 4 ] ( https://reacttraining .com/react-router/web/example/basic )
99* [ webpack 2] ( https://github.com/webpack/webpack )
1010* [ babel stage-0 ] ( https://github.com/babel/babel )
1111* [ eslint] ( http://eslint.org )
Original file line number Diff line number Diff line change 3737 "react" : " ^15.0.1" ,
3838 "react-dom" : " ^15.0.1" ,
3939 "react-hot-loader" : " ^3.0.0-beta.6" ,
40- "react-router" : " ^3.0 .2" ,
40+ "react-router-dom " : " 4.1 .2" ,
4141 "sass-loader" : " ^6.0.6" ,
4242 "style-loader" : " ^0.13.1" ,
4343 "url-loader" : " ^0.5.7" ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
22// import package
3- import { Router , Route , hashHistory } from 'react-router' ;
3+ import { HashRouter as Router , Route , Switch } from 'react-router-dom ' ;
44import 'normalize.css/normalize.css' ;
55
66// import relative path
77import Home from './Home' ;
88import NotFound from './NotFound' ;
99
10-
11- // add router key to fix this issue
12- // https://github.com/reactjs/react-router-redux/issues/179#issuecomment-275576250
1310const Main = ( ) => (
14- < Router key = { Math . random ( ) } history = { hashHistory } >
15- < Route path = "/" component = { Home } />
16- < Route path = "*" component = { NotFound } />
11+ < Router >
12+ < Switch >
13+ < Route exact path = "/" component = { Home } />
14+ < Route component = { NotFound } />
15+ </ Switch >
1716 </ Router >
1817) ;
1918
You can’t perform that action at this time.
0 commit comments