【问题标题】:react-router v4 alternative for v2 match({routes, location}, (err, redirectLocation, renderProps) => {})react-router v4 替代 v2 match({routes, location}, (err, redirectLocation, renderProps) => {})
【发布时间】:2017-03-23 10:14:14
【问题描述】:

我想知道 react-router v4 是否支持匹配。文档是这样说的,但我不断收到TypeError: (0 , _reactRouter.match) is not a function 或者是否有替代方案可以满足 match () 所做的所有事情。

【问题讨论】:

    标签: react-router react-router-dom


    【解决方案1】:

    4.0 完全重写。您将需要重新考虑如何做事,并且没有直接的升级路径。服务器用 渲染,请查看该特定指南: https://reacttraining.com/react-router/web/guides/server-rendering

    这是 timdorr 的回答,他是 github 上 react-router 的合作者之一。

    【讨论】:

      猜你喜欢
      • 2018-02-10
      • 2018-08-28
      • 1970-01-01
      • 2019-01-24
      • 2017-09-04
      • 2017-07-22
      • 2017-10-17
      • 2017-12-22
      • 1970-01-01
      相关资源
      最近更新 更多