【发布时间】:2018-06-15 23:56:17
【问题描述】:
<Route path='/change-password/?resetToken=(:token)' component={()=><h1>testing</h1>} />
当我点击下面的 url 时,上面的路线不呈现?
http://localhost:3000/change-password/?resetToken=123
我也试过path='/change-password/?resetToken=:token'
【问题讨论】:
-
尝试将
<h1>testing</h1包装成return并将您的案例与path='/change-password/?resetToken=:token'一起使用 -
似乎问题出在
resetToken之前的问号,here 是关于 SO 的类似问题,没有答案。我试过了,它在没有?标志的情况下工作,你能改变你的路线,让它像/change-password/resetToken=:token一样,还是你必须保留?那里? -
我希望这就是你想要的stackoverflow.com/questions/35604617/…
标签: javascript reactjs ecmascript-6 react-router