官方文档(https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops)有一句是这样说的:
Using this lifecycle method often leads to bugs and inconsistencies, and for that reason it is going to be deprecated in the future.

到底有哪些bugs和inconsistencies呢?文档里面有这样一句话:
Note that if a parent component causes your component to re-render, this method will be called even if props have not changed. Make sure to compare the current and next values if you only want to handle changes.

即:只要父组件引起了你的组件的 重新render,你的组件就会触发componentWillReceiveProps方法,即使你组件接收的props没有发生任何变化。

希望大家补充的更深刻。。。

componentWillReceiveProps为什么deprecated相关推荐

  1. react引入多个图片_重新引入React:v16之后的每个React更新都已揭开神秘面纱。

    react引入多个图片 In this article (and accompanying book), unlike any you may have come across before, I w ...

  2. react开发插件-ES7 React/Redux/GraphQL/React-Native snippets

    内容目录 ES7 React/Redux/GraphQL/React-Native snippets 插件 Basic Methods React React Native Redux PropTyp ...

  3. warning/error

    1.Identifier xxxxxx is not in camel case. 问题描述:意思就是xxxxxx这个没有用驼峰法命名 举例:<img src={default_logo} al ...

  4. DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5

    原来的python脚本是在Ubuntu 14.04 64bit上写的,运行没有问题,但是在CentOS 6.3上的crontab中定时执行时,每次都报 DeprecationWarning: the ...

  5. 【FFmpeg】解决警告warning: xxx is deprecated [-Wdeprecated-declarations]的方法

    1.问题描述 编译FFmpeg程序时,经常报一些关于"deprecated"的警告信息,具体内容如下: decode.cpp:28:2: warning: 'void av_reg ...

  6. php解决 mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysq

    微信小程序开发交流qq群   173683895    承接微信小程序开发.扫码加微信. The mysql extension is deprecated and will be removed i ...

  7. 解决 The mysql extension is deprecated and will be r

    为什么80%的码农都做不了架构师?>>>    解决 The mysql extension is deprecated and will be removed in the fut ...

  8. neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead

    1.现象描述: 以前在测试环境中使用过icehouse版本,记得当时查看网络列表是使用neutron net-list,最近两天在测试openstack ocata的时候发现好多之前的命令都不能正常使 ...

  9. C++关键字deprecated

    指示声明有此属性的名字或实体被弃用,即允许但因故不鼓励使用. 语法 [[deprecated]] [[deprecated( 字符字面量 )]] 解释 指示允许使用声明有此属性的名称或实体,但因故不鼓 ...

最新文章

  1. T4 (Text Template Transformation Toolkit)实现简单实体代码生成
  2. Attribute在拦截机制上的应用
  3. python开发环境spyder_spyder python 2.7-spyder(Python开发环境)下载 v2.1.10官方版--pc6下载站...
  4. Python类继承简单实现
  5. jquery 的ajax请求示例和注意事项
  6. Android, WindowsPhone7, IOS ,vc2010平台40多套图片滤镜开源
  7. MySQL Cookbook 学习笔记-03
  8. 机器人--寒暄库(4)
  9. 基于 Spring 实现管道模式的最佳实践
  10. mysql怎么查找删除重复数据_Mysql中如何查找并删除重复数据
  11. Appium真机运行Device Name获取方法
  12. if __name__ == '__main__' 的正确理解
  13. HTML编程怎么设置字体,html怎么设置字体
  14. 2019年税务师进行继续教育?
  15. 将List类型数据转为json
  16. 树莓派 无法定位软件包 解决方案
  17. 废旧安卓手机利用(一)安装linux系统(Centos、Debian)
  18. [9i] 我们常说的好朋友:“哥们”、“兄弟”、“死党”、“闺蜜”,以及坏朋友:“小人”、“背叛者”在英文中怎么说。
  19. 【睡服】自动化面试官,就用2020年最全的自动化测试面试题及答案
  20. 任正非谈接班人要求:要具有对新技术与客户需求的深刻理解

热门文章

  1. 浅谈小微企业智能化财务转型
  2. Android 简单文件管理器
  3. 逻辑推理之赵钱孙李周
  4. 大数除法——超详细讲解
  5. Oracle数据库打补丁方法
  6. python3 运行you get_You-Get的安装及使用方法
  7. 哈工大软件构造实验二有感
  8. 电池寿命增压器为android,一个涡轮增压器的寿命只有10年?
  9. K均值聚类的理解和实现
  10. 路在脚下、梦在身上,技能提升不是为了别人!