createClass方法

1、getInitialState 用于定义初始状态,也就是一个对象,这个对象可以通过 this.state 属性读取。

2、getDefaultProps() 方法为 props 设置默认值

posted @ 2017-08-08 08:58  飞鱼0725  阅读(260)  评论(0编辑  收藏  举报