react-native 豆瓣電影的小 demo

項目地址: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

  1. 按評分排序的 20 門電影react-native

  2. 查看電影詳情api

用到了如下基礎知識網絡

  1. 組件app

  2. state

  3. flexbox

  4. ListView

  5. 網絡請求

  6. 頁面跳轉

  7. 觸摸事件

在接下來的學習中,我會繼續完善這個 demo 若是你有好的想法,歡迎與我溝通

演示

tmpdir--16_11_16_16_36_20.gif

相關資料

我是作 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 謝謝

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息