Skip to content

Commit

Permalink
๐Ÿšจ Fix: ํฌ๋กฌ threshold ์ธ์‹ ์•ˆ๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
suyeon1218 committed Oct 9, 2023
1 parent a76b6d4 commit aa385b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/posts/hooks/useObserver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useRef } from 'react';

const useObserver = (callback: () => void) => {
const observerOption = useRef({ threshold: 1 });
const observerOption = useRef({ threshold: 0.5 });
const observerFn: IntersectionObserverCallback = useCallback(
(entries, observer) => {
entries.forEach((entry) => {
Expand All @@ -10,6 +10,7 @@ const useObserver = (callback: () => void) => {
}
if (entry.isIntersecting) {
callback();
console.log('intersectioning');
}
});
},
Expand Down

0 comments on commit aa385b6

Please sign in to comment.