河南——蔚州博物馆馆藏系统

shaogen1995 b0f338d433 first commit 13 godzin temu
.vscode b0f338d433 first commit 13 godzin temu
public b0f338d433 first commit 13 godzin temu
src b0f338d433 first commit 13 godzin temu
.editorconfig b0f338d433 first commit 13 godzin temu
.env b0f338d433 first commit 13 godzin temu
.gitignore b0f338d433 first commit 13 godzin temu
.prettierrc.js b0f338d433 first commit 13 godzin temu
README.md b0f338d433 first commit 13 godzin temu
config-overrides.js b0f338d433 first commit 13 godzin temu
package-lock.json b0f338d433 first commit 13 godzin temu
package.json b0f338d433 first commit 13 godzin temu
path.tsconfig.json b0f338d433 first commit 13 godzin temu
tsconfig.json b0f338d433 first commit 13 godzin temu
yarn.lock b0f338d433 first commit 13 godzin temu

README.md

1.版本类型问题

找到 import { useDispatch } from "react-redux";

按住 Ctrl 点击 useDispatch 出来 useDispatch.d.ts 类型声明文件 (路径 node_modules>react-redux>es>hooks>useDispatch.d.ts)

找到最后面的 AnyAction,按住 Ctrl 点击 进入 (路径 node_modules>redux>index.d.ts)

找到 export interface Action { type: T }

在 type 后面加一个 ? 即=>

export interface Action { type?: T }