回答編集履歴

1

typoの修正

2021/08/22 06:38

投稿

k_a
k_a

スコア983

test CHANGED
@@ -6,15 +6,15 @@
6
6
 
7
7
  useEffect(() => {
8
8
 
9
- const calllback = () => console.log('before unload')
9
+ const callback = () => console.log('before unload')
10
10
 
11
11
 
12
12
 
13
- window.addEventListener('beforeunload', calllback)
13
+ window.addEventListener('beforeunload', callback)
14
14
 
15
15
 
16
16
 
17
- return () => window.removeEventListener('beforeunload', calllback)
17
+ return () => window.removeEventListener('beforeunload', callback)
18
18
 
19
19
  }, [])
20
20