diff --git a/src/components/inViewContainer/index.tsx b/src/components/inViewContainer/index.tsx index 77d1c7c..8e21a0e 100644 --- a/src/components/inViewContainer/index.tsx +++ b/src/components/inViewContainer/index.tsx @@ -21,11 +21,15 @@ export const InViewContainer = ({ const [renderDataIdx, setRenderDataIdx] = useState(1); const ref = useRef(null!); + useEffect(() => { + console.log("renderDataIdx", renderDataIdx); + }, [renderDataIdx]); + useEffect(() => { const observer = new IntersectionObserver(([entry]) => { if (!entry.isIntersecting) return; - setRenderDataIdx((n) => ++n); + setRenderDataIdx((n) => n + 2); }); setTimeout(() => observer.observe(ref.current), 0);