Skip to content

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)