react的component有static属性,里面放函数,官方解释:
you can run them before any component instances are created, and the methods do not have access to the props or state of your components.
不理解既然不能取到props和state,那么和一个普通的函数有啥区别。
所以我的问题就是,react设计static函数到底是干嘛用的呢,最好结合具体场景说下,谢谢大家。
绝地无双
相关分类