问题:
I've seen both used interchangeably. 我看过两者都可以互换使用。
What are the main use cases for both? 两者的主要用例是什么? Are there advantages / disadvantages? 有优点/缺点吗? Is one a better practice? 这是一个更好的做法吗?
解决方案:
参考一: https://stackoom.com/question/24gEQ/在React-React-Native中使用构造函数与getInitialState有什么区别参考二: https://oldbug.net/q/24gEQ/What-is-the-difference-between-using-constructor-vs-getInitialState-in-React-React-Native
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4418902