小编Shr*_*ani的帖子

为什么要弃用componentWillReceiveProps?

我通读了https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#fetching-external-data-when-props-change.我仍然无法理解为什么他们必须弃用componentWillReceiveProps.
在componentWillReceiveProps中进行ajax调用有什么危害?一旦ajax调用返回值,我就更新状态,从而重新渲染组件.

reactjs

17
推荐指数
2
解决办法
1万
查看次数

标签 统计

reactjs ×1