【发布时间】:2015-12-23 15:26:36
【问题描述】:
http://fluxxor.com/examples/react-router.html#/
这显示了如何为旧版本的 React-router 执行此操作。
有谁知道如何在 react-router 1.0.0 中将通量作为道具传递给您的顶级组件?
我在文档中的某处看到 react-router 1.0.0 中的路由只能被描述为对象,这意味着您可以传入任意道具。但是这对我不起作用:
routes =
path: "/"
flux: flux
component: App
childRoutes: [
{path: "/path/to/path", component: Comp, flux: flux}
]
React.render(<Router routes={routes} />, document.getElementById("app"))
App 上没有 Flux 的迹象。
语法是 Coffee Script 但基本上路由是一个对象,
【问题讨论】:
标签: reactjs flux react-router