标签: reactjs react-router router
我正在像这样使用withRouter:
const SubMenu = props => ( <div className="subMenu"> <h2>{props.location.pathname}</h2> </div> ); export default withRouter(SubMenu);
如何获取活动组件的名称而不是路径?