React 在哪个生命周期里监听props变化发请求
先说答案 (第三个参数 是 getSnapShotbeforeUpdate 的返回值)
componentDidUpdate(prevProps, prevState, snapshot)
Use this as an opportunity to operate on the DOM when the component has been updated. This is also a good place to do network requests as long as you compare
原创
2022-03-17 16:05:02 ·
2599 阅读 ·
0 评论