react-router v4 alternative for v2 match({routes, location}, (err, redirectLocation, renderProps) => {})

react-router v4 alternative for v2 match({routes, location}, (err, redirectLocation, renderProps) => {})

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

4.0 is a complete rewrite. You will need to rethink much of how you do things and there isn't a straightforward upgrade path. For server rendering, check out that specific guide: https://reacttraining.com/react-router/web/guides/server-rendering

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