Reactjs 将数据传递给父路由器
我有一个简单的React应用程序,使用React路由器确定要显示的页面:Reactjs 将数据传递给父路由器,reactjs,react-router,Reactjs,React Router,我有一个简单的React应用程序,使用React路由器确定要显示的页面: <Router history={hashHistory}> <Route component={Navigation}> <IndexRoute component={HomePage}/> <Route path="/home" component={HomePage} /> <Route path="/ord
<Router history={hashHistory}>
<Route component={Navigation}>
<IndexRoute component={HomePage}/>
<Route path="/home" component={HomePage} />
<Route path="/orders" component={OrderPage} />
<Route path="/accounts" component={AccountPage} />
</Route>
</Router>
很简单,这很有效。不过我想做的是让导航元素包含当前页面中的一些数据。特别是页面的名称。因此,当在订单页面上时,导航元素将显示“订单”,当在账户页面上时,导航元素将包含文本“账户”
但是如何传递这些数据呢
如果有什么不同的话,我会使用material ui()库作为ui组件