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函數到底是干嘛用的呢,最好結合具體場景說下,謝謝大家。
react的static函數設計的目的是什么呢?
子衿沉夜
2018-09-14 06:17:25