關(guān)于getInitialState的寫法
如果寫成:
????getInitialState() {
? ? return {
? ? imgsArrangeArr:[]
????}
????}
就會彈出這個警告:getInitialState was defined on AppComponent, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?
如果寫成getInitialState: function() {}的形式 ?就會提示在這個地方有語法錯誤。。。
2017-10-30
2017-10-30
2016-06-29
?getInitialState() {
? ? return {
? ? imgsArrangeArr:[]
????};
????}
//少寫了個;