組件化時遇到的 state 問題
Mater老師您好,我試圖使用新版的React+ES6寫畫廊應(yīng)用,現(xiàn)在遇到一個問題:要么中心圖片沒法翻轉(zhuǎn),要么沒法點擊切換圖片,搞了很久都沒弄好?,F(xiàn)在判斷是 image 組件 state 的問題(我把image單獨作為一個組件了),但是不知道怎么才能改好,向您請教!?
Demo:http://sstruct.github.io/playground/
源碼:https://github.com/sstruct/playground/tree/master/UnsplashGallery
2016-08-06
以下我的源碼,同樣采用了默認(rèn)的ES6模式,一切正常:
https://github.com/nzbin/imooc-ScatteredPolaroidsGallery-by-react/
2016-06-22
既然都es6了就別let x= require(x)了,還有forEach試試箭頭函數(shù)