0
下面是我的路由代碼。我能夠從displaylist路由到informationlist和信息列表我從數據庫中獲取所有數據,但是我想根據他們的Id或其他顯示一個學生顯示數據。我現在應該怎麼做? 每次我需要顯示不同的學生的詳細信息。如何從數據庫中的對象數組中路由和顯示特定的對象?
這是我的路由器。
<Router history={hashHistory}>
<Route path="/" component={App}/>
<Route path="/students" component={Students}/>
<Route path="/holidays" component={Calender}/>
<Route path="/premontessori" component={Premontessori}/>
<Route path="/createstudent" component={Createstudent}/>
<Route path="/montessori1" component={Montessori1}/>
<Route path="/montessori2" component={Montessori2}/>
<Route path="/displaylist" component={Displaylist}/>
<Route path="/information" component={Information}/>
</Router>, document.getElementById('app'));
這是從顯示列表我的鏈接informationlist
<Link to="/information" style={{textDecoration:'none'}} >
你能給我一些鏈接的文檔,這樣我可以去通過它詳細 –
這裏雅'去https://github.com/ReactTraining/react-router/blob/master/docs/guides/ComponentLifecycle.md#fetching-data –