Skip to content

Commit 0127c2d

Browse files
authored
Merge pull request #105 from OFK0/typo-fix
fix: typo
2 parents 3795f57 + 8393e4a commit 0127c2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/useInterval.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useEffect, useRef } from 'react';
22

33
export default function useInterval(callback, delay) {
4-
const callbacRef = useRef();
4+
const callbackRef = useRef();
55

66
// update callback function with current render callback that has access to latest props and state
77
useEffect(() => {
8-
callbacRef.current = callback;
8+
callbackRef.current = callback;
99
});
1010

1111
useEffect(() => {
@@ -14,7 +14,7 @@ export default function useInterval(callback, delay) {
1414
}
1515

1616
const interval = setInterval(() => {
17-
callbacRef.current && callbacRef.current();
17+
callbackRef.current && callbackRef.current();
1818
}, delay);
1919
return () => clearInterval(interval);
2020
}, [delay]);

0 commit comments

Comments
 (0)