随笔分类 - React
摘要:npm install customize-cra react-app-rewired @babel/plugin-proposal-decorators --save
阅读全文
摘要:1.创建actions (actionType.js ,cart.js) actionType.js export default { CART_AMOUNT_INCREMENT:'CART_AMOUNT_INCREMENT', CART_AMOUNT_DECREMENT:'CART_AMOUNT_
阅读全文
摘要:import React, { Component ,createContext} from 'react' console.log(createContext()) const { Provider, //提供者 Consumer:CounterConsumer //解构出来重新赋值给一个Coun
阅读全文
摘要:页面通过(dispatch)分派给Effect Effect通过给(put) reducer reducer通过连接(connect) 给页面
阅读全文
摘要://组件加载的时候 constructor(props){ super(props) this.state = { msg:'张学友' } } //组件将要挂载 componentWillMount(){ } //数据渲染 render(){ } //组件挂载完成的时候 componentDidMo
阅读全文