react笔记
React 2014年
1. 对比三大框架 Angular , React , Vue
2. React 只负责View层
3. React 轻 ,数据单向绑定,独立小巧 快速 创新 组件化开发
4. 适合的场景 复杂场景的高性能 懒 难
知识 Html ,js ,css
Sass compass
Yeoman grunt webpack
CommonJs NodeJs
Git Github
JSX
React 生命周期
Mounted Update Unmounted
ConponentWillMount
Render
ComponnetDidMount
单身数据流
管理UI状态
getInitialState, this.state.titileMessage
Centos 下面安装node js 和yarn
https://blog.csdn.net/lu_embedded/article/details/79138650
正确的安装方法 将8.x换成10.x
编译不过 内存不够的问题
free
dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
mkswap /var/swap.img
swapon /var/swap.img
free
make -f makefile.unix
参考文章 JSX语法学习
https://eyesofkids.gitbooks.io/react-basic-zh-tw/content/day05_es6_let_const/
Yarn install 出问题的时候单独 安装这个 npm i –save puppeteer
ReactJS的三个数据传递组件
State, Prpos, Context
getChildContext(){
Return {
A:100
}
.childContextType{
A:protypes.number.isrequeired
五,其他api
5.1 无状态组件
5.2 复合组件
5.3 默认 Props
5.4 组件的生命周期
挂载 更新 移除
getInitialState() 不能使用
ComponetWillMount ()
ComponetDidMount()
ComponetWillReceiveProps(){
5.5 Redux
6 Flux
Action Dispatcher Stodicre View
Action
Disptcher
Store
View