4

私は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ですか?

4

1 に答える 1