Skip to content

Commit 8f4badd

Browse files
committed
docs: improve comment
1 parent a3e2be5 commit 8f4badd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/useInView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export function useInView({
5353
entry: undefined,
5454
});
5555

56-
// Store the onChange callback in a `ref`, so we can access the latest instance inside the `useCallback`.
56+
// Store the onChange callback in a `ref`, so we can access the latest instance
57+
// inside the `useEffect`, but without triggering a rerender.
5758
callback.current = onChange;
5859

5960
React.useEffect(

0 commit comments

Comments
 (0)