Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1099022

Browse files
author
Julio Soto
committed
fix: useEffect cleanup function
1 parent 70b23ac commit 1099022

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/final/02.extra-3.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ function useSafeDispatch(dispatch) {
2121
// interact with the dom may depend on the value being set
2222
React.useEffect(() => {
2323
mountedRef.current = true
24-
return () => (mountedRef.current = false)
24+
return () => {
25+
mountedRef.current = false
26+
}
2527
}, [])
2628

2729
return React.useCallback(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /