- pureComponent
import {
useState } from "react"
// useReducer,
// 统一调度
function reducer(state, action) {
console.log('reducer接收参数', state, action)
const {
type } = action
switch (type) {
case 'add'
import {
useState } from "react"
// useReducer,
// 统一调度
function reducer(state, action) {
console.log('reducer接收参数', state, action)
const {
type } = action
switch (type) {
case 'add'