react-router Link无法解析param 2.0.0-rc5

时间:2016-01-24 14:37:24

标签: reactjs react-router

我无法解决这个问题:

<Link to={'/items/${this.props.id}'}>{this.props.name}</Link>

使用此路由配置:

const routes = <Route path="/" component={App}>
        // default route for '/' path
        <IndexRoute component={Main} />
        <Route path="/items/:id" component={ItemForm} />
    </Route>

点击链接时,我在ItemForm上收到文字值$ {this.props.id}作为参数。

使用以下语法:

<Route name="itemForm" path="/items/:id" component={ManageProcessPageContainer} />
    <Link to="itemForm" params={{ id: "123"}} >{this.props.name}</Link>

导致错误

  

警告:[react-router]位置&#34; / itemForm&#34;没有匹配任何路线

react-router如何在这里解析$ part? 谢谢!

0 个答案:

没有答案
相关问题