1
目前,我得React-router:如何將`components`道具傳遞給祖先?
<Route path="/" component={App}>
<Route path="page1" components={{content: C1, aside: A1}} />
<Route path="page2" components={{content: C2, aside: A2}} />
<Route path="page3" components={{content: C3, aside: A3}} >
<Route path="page3-sub" components={{content: C3Sub, aside: A3Sub}} />
</Route>
</Route>
類似的結構在這種路由配置page3-sub
的組件不使其向App
:他們正在被page3
‘覆蓋’的。有沒有辦法保持這種路由結構和使用page3-sub
的組件?
安東尼嗨,如問題所說,我需要一個特定的路由結構,但由於! – aryzing
這也是可行的。我確定我記得有人在反應路由器github的幫助渠道有確切的問題,他們通過使用這種方法解決它。更新你的路徑,如下所示: 對不起,如果我誤導了你, ,我不能測試。 –
http://stackoverflow.com/questions/32303221/react-router-nested-routes-not-working –