`

stateless functional component

 
阅读更多

 

Component vs Stateless Functional component

  1. Component包含内部state,而Stateless Functional Component所有数据都来自props,没有内部state;

  2. Component 包含的一些生命周期函数,Stateless Functional Component都没有,因为Stateless Functional component没有shouldComponentUpdate,所以也无法控制组件的渲染,也即是说只要是收到新的props,Stateless Functional Component就会重新渲染。

  3. Stateless Functional Component 不支持Refs

https://www.cnblogs.com/Unknw/p/6431375.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics