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 1982518

Browse files
committed
effect needs latest state of timer (version 1)
1 parent 171b61b commit 1982518

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/useEffect-example/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function App() {
1414

1515
return () => clearInterval(interval);
1616
},
17-
[isOn],
17+
[isOn,timer],
1818
);
1919

2020
const onReset = () => {

0 commit comments

Comments
(0)

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