Skip to content

Commit 62ad138

Browse files
committed
Resolves velopert#228
Missing deps in useEffect
1 parent 727022a commit 62ad138

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

corrections.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
+ SyntheticEvent는 네이티브 이벤트와 달리 이벤트가 끝나고 나면...
1010
```
1111

12+
## 8.2.3 (pg. 199) - 개선사항
13+
14+
`useEffect`를 사용하는 부분의 deps 배열이 비어있어서 ESLint 경고가 나타납니다. 이 경고를 없애기 위하여 deps 배열에 name 을 넣어주세요.
15+
16+
```diff
17+
useEffect(() => {
18+
console.log('effect');
19+
console.log(name);
20+
return () => {
21+
console.log('cleanup');
22+
console.log(name);
23+
};
24+
- }, []);
25+
+ }, [name]);
26+
```
27+
1228
## 16.2.10 (pg. 426)
1329

1430
페이지 하단 설명에 오탈자가 있습니다.

0 commit comments

Comments
 (0)