【发布时间】:2015-07-07 18:16:38
【问题描述】:
我不知道如何使用任何相对较新(react 13+)版本的 React-router 。当前README 的示例建议通过直接渲染Router 来集成它(通过子Route 元素定义路由)。另一位官方overview doc 似乎建议使用Router.run。 react-router examples 使用前者。没有一个对我有用:根据使用情况,我会遇到不同的错误:
- 当rendering the
Routerelement directly 尝试使用 react-router 时,我收到“未捕获的错误:不变违规:A 需要一个有效的位置” - 在尝试使用 running
Router.runwith routes 的 react-router 时,我收到“未捕获的类型错误:无法读取属性 'toUpperCase' of null”
【问题讨论】:
-
上面链接的所有代码,但我想我没有说得那么明显。对不起。从这里开始:github.com/nonword/react-router-tests/blob/master/app/assets/…
标签: reactjs react-router