【发布时间】:2016-08-26 00:14:51
【问题描述】:
有谁知道在使用 React Router 时如何在 React 中获取 URL 参数?
我正在尝试做这样的事情:
filterList(key) {
if (key===this.props.location.query){
return Blogstore.state.blog
}
与链接末尾的唯一键匹配:
【问题讨论】:
标签: reactjs react-router
有谁知道在使用 React Router 时如何在 React 中获取 URL 参数?
我正在尝试做这样的事情:
filterList(key) {
if (key===this.props.location.query){
return Blogstore.state.blog
}
与链接末尾的唯一键匹配:
【问题讨论】:
标签: reactjs react-router
答案是:
this.props.routeParams.key
【讨论】: