react-router 中onEnter ,onLeave函数只能监测到当前组建的,难道没有全局监测的钩子函数吗?或者有没有什么好的办法呢?每个组件都写后期不好维护啊,也麻烦?求前辈指导!
react-router没有像vue-router中beforeEach一样全局钩子函数吗?
awaw00
#2
<Router history={...}>
<Route onEnter={...}>
<Route path="/" component={...}/>
...
</Route>
</Router>
以上代码未经验证