1、params参数:
路由链接(携带参数):详情
注册路由(声明接收):
接收参数: this.props.match.params
2、search参数:
路由链接(携带参数):<Link to=“/demo/test?name=tom&age=18”>详情
注册路由(无需声明,正常注册即可):
接收参数: this.props.location.search
备注:获取到的search是urlencoded编码字符串,需要借助querystring解析。
3、state参数:
路由链接(携带参数):<Link to={{pathname:‘/demo/test’,state: {name: ‘tom’,age:18}}}>详情
注册路由(无需声明,正常注册即可):
接收参数: this.props.location.state
备注:如果不用BrowserRouter,刷新保留不住参数,因为BrowserRouter的history里保留了参数信息。








