---
# System prepended metadata

title: React Hook
tags: [hook, react]

---

# React Hook
###### tags: `react` `hook`
在 useEffect 中不要使用 await 
```javascript=
useEffect(async()=>{
    await someFunction();
})
```
應該把需要 await 的 function 移出來

```javascript=
useEffect(()=>{
    someAsyncFunction();
})

someAsyncFunction = async() =>{
    await someFunction();
}
```