react-router+antD/ How to highlight a menu item when press back/forward button?
问题 I create a menu and want to highlight the item which i choose,and i did it. But when i press back/forward button,the menu item don't highlight. What should i do? I have tried to use addEventListener but failed. Have someone could give some advice? class Sidebar extends React.Component { constructor(props) { super(props); this.state={ test: "home" } this.menuClickHandle = this.menuClickHandle.bind(this); } componentWillMount(){ hashHistory.listen((event)=>{ test1 = event.pathname.split("/"); }