react学习笔记

1.如何创建组件:

React.createClass({
    getInitialState: function () {
        return {} // 返回state
    },
    render: function () {return <div></div>}
})

2.组件中得属性:

this.state:getInitialState返回的
this.props:标签里面的属性

3.组件的生命周期:

装载组件触发:

  • componentWillMount

只会在装载之前调用一次,在 render 之前调用

  • componentDidMount

只会在装载完成之后调用一次,在 render 之后调用

更新组件触发:

componentWillRecevieProps
shouldComponentUpdate
componentWillUpdate
componentDidUpdate

卸载组件触发:

componentWillUnmount

4.使用webpack打包react

github地址

5.react-native

教程
https://devdactic.com/react-native-firebase-todo/

6.有用文章

已买到的宝贝前端组件化探索
http://taobaofed.org/blog/2015/11/02/buy-component/
React Native实战 by 鬼道@天猫
http://airjd.com/view/iap1mz440004r90#33
一个资深iOS开发者对于React Native的看法
http://www.linuxidc.com/Linux/2015-09/123239.htm


参考资料:
React 入门教程 https://hulufei.gitbooks.io/react-tutorial/content/introduction.html
深入浅出React http://www.infoq.com/cn/articles/react-art-of-simplity

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值