?設(shè)置默認(rèn)getDefaultProps()報錯
getDefaultProps()設(shè)置Poprs的默認(rèn)數(shù)據(jù)報錯“proxyConsole.js:56 Warning: getDefaultProps was defined on Progress, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.
我用的是Component創(chuàng)建的組
件,不是createClass。
2018-07-12
2018-03-18
如果用es6寫的話 參考如下:
還需要安裝 "babel-preset-stage-0"?
并且在webpack.config.js里添加stage-0
2017-11-30
ES6 寫法
static defaultProps = {
? ?selectedTabItem : 0
}
2017-09-11
使用ES6類的寫法?
constructor(props) { ? ?
super(props); ? ?
this.state = { ? ?
musiclist : MUSIC_LIST, ? ?
currentMusicItem: MUSIC_LIST[0], ? ?
isPlay:null ? ?
}; ? ?
} ? ?