shaogen1995 e4dbc967fd upp hai 1 ano
..
public e4dbc967fd upp hai 1 ano
src e4dbc967fd upp hai 1 ano
.gitignore 6e3e5026f5 'init' hai 1 ano
README.md a809f80cde upp hai 1 ano
config-overrides.js 6e3e5026f5 'init' hai 1 ano
package-lock.json 6e3e5026f5 'init' hai 1 ano
package.json 6e3e5026f5 'init' hai 1 ano
path.tsconfig.json 6e3e5026f5 'init' hai 1 ano
tsconfig.json 6e3e5026f5 'init' hai 1 ano

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 }