|
@@ -1,3 +1,27 @@
|
|
|
本地运行:静态资源里面先运行一个服务
|
|
|
使用 http-server
|
|
|
确保服务地址是:http://127.0.0.1:8080
|
|
|
+
|
|
|
+
|
|
|
+-------------------
|
|
|
+
|
|
|
+------ts版本类型问题-------
|
|
|
+
|
|
|
+找到 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<T = any> {
|
|
|
+ type: T
|
|
|
+}
|
|
|
+
|
|
|
+在type后面加一个 ? 即=>
|
|
|
+
|
|
|
+export interface Action<T = any> {
|
|
|
+ type?: T
|
|
|
+}
|