Skip to content

Commit aa385b6

Browse files
committed
🚨 Fix: 크롬 threshold 인식 안되는 문제 수정
1 parent a76b6d4 commit aa385b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pages/posts/hooks/useObserver.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback, useRef } from 'react';
22

33
const useObserver = (callback: () => void) => {
4-
const observerOption = useRef({ threshold: 1 });
4+
const observerOption = useRef({ threshold: 0.5 });
55
const observerFn: IntersectionObserverCallback = useCallback(
66
(entries, observer) => {
77
entries.forEach((entry) => {
@@ -10,6 +10,7 @@ const useObserver = (callback: () => void) => {
1010
}
1111
if (entry.isIntersecting) {
1212
callback();
13+
console.log('intersectioning');
1314
}
1415
});
1516
},

0 commit comments

Comments
 (0)