I have a demo here
(我在这里有一个演示)
It's a React app using Typescript and hooks to capture entries into form that are simple displayed below.
(这是一个使用Typescript和钩子的React应用程序,可将条目捕获为以下简单显示的形式。)
Here in Stackblitz it works but locally I am using VS code and I get an error for setUser(userData);
(在这里,它在Stackblitz中可以工作,但在本地使用VS代码,但出现setUser(userData);
错误setUser(userData);
)
the error is (错误是)
const userData: {
username: string;
password: string;
prevState: null;
}
Argument of type '{ username: string; password: string; prevState: null; }' is not assignable to parameter of type '(prevState: null) => null'.
Type '{ username: string; password: string; prevState: null; }' provides no match for the signature '(prevState: null): null'.ts(2345)
How can I fox this typescript error
(我该如何解决此打字稿错误)
ask by cdmt translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…