項目地址:https://github.com/yccphp/react-native-demophp
最近在研究 react-native 作了一個小 demohtml
感受文檔上仍是有點坑的,好比 觸摸事件的時候,文檔會告訴你這樣寫react
class MyButton extends Component { _onPressButton() { console.log("You tapped the button!"); } render() { return ( <TouchableHighlight onPress={this._onPressButton}> <Text>Button</Text> </TouchableHighlight> ); } }
可是其實你的 onPress 若是不用 .bind(this)
的話,你是取不到 this 的一些數據的,因此我就把這個 demo 放到了 github git
我也才研究了兩天,代碼可能寫的有點亂,你們湊合着看哈~github
實現的功能有redux
按評分排序的 20 門電影react-native
查看電影詳情api
用到了如下基礎知識網絡
組件app
state
flexbox
ListView
網絡請求
頁面跳轉
觸摸事件
在接下來的學習中,我會繼續完善這個 demo 若是你有好的想法,歡迎與我溝通
我是作 PHP 的,從開始到如今的 demo 用了三天,如下是個人學習路徑與資料
學習路徑
ES6->React->React-Native->Redux
學習資料
參考阮一峯的快速入門大綱:http://www.ruanyifeng.com/blog/2016/09/react-technology-stack.html
進階:
ADVANCED GUIDES :https://facebook.github.io/react/docs/hello-world.html
React Native :http://reactnative.cn/docs/0.37/getting-started.html
Redux 中文文檔:http://cn.redux.js.org/docs/api/index.html
另外,大家有沒有比較好的學習資料,跪求分享
若是這個項目給你帶來了幫助,或者鼓勵我,請 star
謝謝