企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
## 前言 本文主要讲述react-router的相关基础知识。 ## 安装与使用 ~~~ $ npm install -S react-router import { Router } from 'react-router'; render(<Router/>, document.getElementById('app')); import { Router, Route, hashHistory } from 'react-router'; render(( <Router history={hashHistory}> <Route path="/" component={App}/> </Router> ), document.getElementById('app')); ~~~ ## 路由传参 ### params ### query ### state ## 路由钩子 ## 参考文档 - [阮老师react-router教程](http://www.ruanyifeng.com/blog/2016/05/react_router.html) -