私はreact-routerプラグインを使用してルートを設定しています.2つのルートを提供したいです. list/
(list/:id
かなり一般的です)
<Routes>
<Route handler={App}>
<Route name="list"
handler={ListComponent}
collection={new Collection()}>
</Route>
</Route>
</Routes>
しかし、「詳細」ルートを機能させるのに苦労しています。私が試したのは:
<Routes>
<Route handler={App}>
<Route name="list"
handler={ListComponent}
collection={new Collection()}>
<Route name="list.details"
path="list/:id"
handler={DetailsComponent}>
</Route>
</Route>
</Routes>
まず、これは現在機能していDetailsComponent
ません。list/123 にアクセスするときにレンダリングされません (例)
2番目に、これがうまくいくとしても、コレクション内の1つのモデルを「ダウン」に渡すにはどうすればよいDetailsComponent
ですか?