Reactjs React with React路由器中的Url参数

Reactjs React with React路由器中的Url参数,reactjs,react-router,Reactjs,React Router,当使用React路由器时,有人知道如何在React中获取URL参数吗 我正在尝试这样做: filterList(key) { if (key===this.props.location.query){ return Blogstore.state.blog } 要与“我的链接”末尾的唯一键匹配,请执行以下操作: 答案是: this.props.routeParams.key

当使用React路由器时,有人知道如何在React中获取URL参数吗

我正在尝试这样做:

filterList(key) {
   if (key===this.props.location.query){
    return Blogstore.state.blog
   }
要与“我的链接”末尾的唯一键匹配,请执行以下操作:

答案是:

this.props.routeParams.key