React Hook 小提示 Posted on 2020-05-29 Edited on 2020-10-05 在 useEffect 中不要使用 await 123useEffect(async()=>{ await someFunction();}) 應該把需要 await 的 function 移出來 1234567useEffect(()=>{ someAsyncFunction();})someAsyncFunction = async() =>{ await someFunction();}