react-redux
自由的音符
这个作者很懒,什么都没留下…
展开
-
5.createContext、useContext+useReducer实现react-redux
useContext+useReducer实现react-reduximport React, { useReducer,useContext,createContext } from 'react'import { ADD_NUM } from './store/actionTypes'import { numRreduce } from './store/reducer'创建上下文空间const NumContext=createContext()子组件改为consumer写法===原创 2021-12-03 15:34:35 · 255 阅读 · 0 评论 -
React-redux基本使用
index.js中/* * @Description: * @Author: cqj * @Date: 2021-12-02 10:25:52 * @LastEditTime: 2021-12-03 11:30:38 * @LastEditors: cqj * @Reference: */import ReactDOM from 'react-dom'import App from './App.jsx'//引入提供器 //react-redux写法import { Provide原创 2021-12-03 11:44:13 · 215 阅读 · 0 评论