根据官方文档,满足以下任意条件的模块,就不是State,原文如下:

1、Is it passed in from a parent via props? If so, it probably isn’t state.
2、Does it remain unchanged over time? If so, it probably isn’t state.
3、Can you compute it based on any other state or props in your component? If so, it isn’t state.

即:

  1. 如果是由props传递过来的,那么该模块就不是一个state;
  2. 如果所时间保持不变,那么该模块就不是一个state;
  3. 如果可以根据任何一个state或props来计算得出,那么该模块就不是一个state;

我上面的表述可能有些不恰当,我这里说的【模块】,请尽量理解为开发过程中我们划分出来的独立功能区域。

官方地址:https://reactjs.org/docs/thinking-in-react.html

最新文章

  1. CADisplayLink 及定时器的使用
  2. (转)LSTM NEURAL NETWORK FOR TIME SERIES PREDICTION
  3. IE6/IE7中display:inline-block解决办法
  4. CNV
  5. Excel中的隐藏函数
  6. 每天一个Linux命令(7): cp
  7. hdu 3807
  8. jQuery 遍历 json 方法大全
  9. ViewPager实现页卡的最新方法--简洁的TabLayout(谷歌支持包)
  10. Centos 7部署大众点评CAT(一)——单服务器部署
  11. prerender-spa-plugin Vue预渲染配合meta-info优化seo
  12. mac 上如何安装非app store上的下载的软件-------打开未知来源
  13. Netty 学习笔记(1)通信原理
  14. printf 字符串格式化
  15. 网卡驱动-BD详解(缓存描述符 Buffer Description)
  16. JS中怎么调用<%%>的值
  17. E - An Awful Problem 求两段时间内满足条件的天数//lxm
  18. Python 运行其他程序
  19. c++第二次作业
  20. JAVA二叉树递归构造、二叉树普通遍历及递归遍历

热门文章

  1. QT编译时出现警告 Warning: Class Node implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
  2. Apache htcacheclean命令
  3. 34.UCASE() LCASE() 函数
  4. U14.04 teamviewer install
  5. 实践作业3:白盒测试---细化明确任务DAY5
  6. nmap 笔记
  7. NAO机器人
  8. springboot调用微信的jscode2session报JSONObject异常
  9. tornado设置cookie过期时间(expires time)
  10. ajax 跨域名调用