徐州汉画象石万物墙后台

shaogen1995 38d4391599 up-ts类型问题-md里面 1 year ago
public 344e2bde71 init 2 years ago
src 8cd9027a66 upp 2 years ago
.gitignore 344e2bde71 init 2 years ago
README.md 38d4391599 up-ts类型问题-md里面 1 year ago
config-overrides.js 344e2bde71 init 2 years ago
package-lock.json 0223e9d110 🐛兼容360.自己封装上下文 antd 轻提示 2 years ago
package.json 0223e9d110 🐛兼容360.自己封装上下文 antd 轻提示 2 years ago
path.tsconfig.json 344e2bde71 init 2 years ago
tsconfig.json 344e2bde71 init 2 years ago

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 }