【发布时间】:2018-12-13 13:55:51
【问题描述】:
我想在<AppBar /> 中显示一个title,它以某种方式从当前路由传入。
在 React Router v4 中,<AppBar /> 如何能够将当前路由传递到它的 title 属性中?
<Router basename='/app'>
<main>
<Menu active={menu} close={this.closeMenu} />
<Overlay active={menu} onClick={this.closeMenu} />
<AppBar handleMenuIcon={this.handleMenuIcon} title='Test' />
<Route path='/customers' component={Customers} />
</main>
</Router>
有没有办法从<Route /> 上的自定义prop 传递自定义标题?
【问题讨论】:
标签: reactjs react-router react-router-v4