Closed 946629031 closed 3 years ago
使用react hook 的useEffect来模拟react生命周期 useEffect(() => { console.log('模拟componentDidMount以及componentDidUpdate'); return () => { console.log('模拟componentWillUnmount'); } })
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
DVA 怎么使用 react 的生命周期函数?例如 componentdidmount, componentDidShow 之类的?
我现在需要 监听页面的 onShow 事件,也就是 componentDidShow 生命周期函数,
每次当页面重新被显示的时候,我要 初始化一个值,如 activeKey = '1' 。 这种情况 我在dva中,应该如何实现??