useEffect(() => {
async function getTok() {
await Gettestimon();
alldoc.map(forget => console.log(forget.name));
setcondi(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
}
getTok();
}, []);
每当我编译突出显示的代码时,它都会说我的函数gettestimon代表获取推荐,而不是其他东西,未在效果中导入,但最终它仍然可以工作。我想知道如何解决这个问题,但我在某处读到并补充道:
// eslint-disable-next-line react-hooks/exhaustive-deps
我怎样才能解决这个问题?
确切的错误是:
React Hook useEffect has a missing dependency: 'Gettestimon'. Either include it or remove the dependency array.eslintreact-hooks/exhaustive-deps
 慕少森
慕少森 
					慕标5832272
 
					呼如林
 随时随地看视频慕课网APP
随时随地看视频慕课网APP
相关分类