React.createClass( ) 和 React.Component( ) 的寫法有很多不同噢,使用component不能用getInitialState會沒有用,要改為constructor的寫法,并且constant的初始化也要寫在constructor里面,,踩過n多坑的特來提醒下http://blog.csdn.net/u014695532/article/details/52830545
2016-12-25
最新回答 / 慕仔2839162
都不貼下代碼~最新yomen下載下來的React腳手架是采用es6類寫法的,如果你用的是最新的那就不應(yīng)該這么寫函數(shù)了,這樣寫 rearrange(centerIndex) {...}
2016-12-24
最近es6完整項目 https://github.com/daydayupsnail/react-practice-gallery/
新項目,已經(jīng)是不是grunt的了
演示地址 https://daydayupsnail.github.io/react-practice-gallery/
各種筆記,記錄了各種坑 https://daydayupsnail.github.io/react/react-gallery
有用幫忙點贊哦。
新項目,已經(jīng)是不是grunt的了
演示地址 https://daydayupsnail.github.io/react-practice-gallery/
各種筆記,記錄了各種坑 https://daydayupsnail.github.io/react/react-gallery
有用幫忙點贊哦。
2016-12-20
最近es6完整項目 https://github.com/daydayupsnail/react-practice-gallery/
演示地址 https://daydayupsnail.github.io/react-practice-gallery/
安裝筆記,記錄了各種坑 https://daydayupsnail.github.io/react/react-gallery
有用幫忙點贊哦
演示地址 https://daydayupsnail.github.io/react-practice-gallery/
安裝筆記,記錄了各種坑 https://daydayupsnail.github.io/react/react-gallery
有用幫忙點贊哦
2016-12-20
最贊回答 / 慕仔2839162
this作用域的問題,用es6箭頭函數(shù)就可以拿到正確的this,如果是es5的寫法,那你要在函數(shù)調(diào)用后加.bind(this);
2016-12-19