0
在路由器v3中,我们使用了onLeave。在v4中,最接近onEnter似乎是componentWillMount。然而,componentWillUnmount对于onLeave来说似乎并没有那么有效。取代onLeave的最佳生命周期方法
什么是最好的lifecyle方法(或其他做法)来代替onLeave?
在路由器v3中,我们使用了onLeave。在v4中,最接近onEnter似乎是componentWillMount。然而,componentWillUnmount对于onLeave来说似乎并没有那么有效。取代onLeave的最佳生命周期方法
什么是最好的lifecyle方法(或其他做法)来代替onLeave?
感谢答案。我在考虑更多的是发布一个函数或讨论会话(如果使用会话),而不是提示或与用户交互,以确保他们正确地做了一切。 'onEnter:function doThis' 'onLeave:function doThat' – DORRITO