一、react-router
官方文档https://reacttraining.com/react-router/web/guides/quick-start
//安装路由web端
npm install --save react-router-dom
//修改入口文件index.js
import {BrowserRouter, HashRouter} from 'react-router-dom'
ReactDOM.render(
(
<BrowserRouter>
<App/>
</BrowserRouter>
/*<HashRouter>
<App />
</HashRouter>*/
),
document.getElementById('root')
)
网友评论