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 谢谢

相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息