![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
React
文章平均质量分 74
Silent_.
这个作者很懒,什么都没留下…
展开
-
react 中 redux的简单使用
npx create-react-app counter --template redux 一、安装reduxnpm install redux --save# 或yarn add redux二、redux文件目录的构建(src目录下创建store文件夹)1、创建store/index.js 文件store就是整个项目保存数据的地方,并且只能有一个。创建store就是把所有的reducer给他import { createStore } from 'redux'impo原创 2021-03-19 15:37:32 · 164 阅读 · 0 评论 -
React生命周期详解
生命周期初始化initialization阶段class Test extends Component { constructor(props) { super(props); }}也就是以下代码中类的构造方法( constructor() ),Test类继承了react Component这个基类,也就继承这个react的基类,才能有render(),生命周期等方法可以使用,这也说明为什么函数组件不能使用这些方法的原因。super(props)用来调用基类的构造方法( con原创 2021-03-15 17:37:21 · 272 阅读 · 2 评论