From 3b50fff8ee28b3a1227a8967f83de84e1d432526 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Fri, 12 Jan 2024 23:24:32 +0300 Subject: [PATCH] Fixed deferred loader --- components/demo/DeferredDemo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/demo/DeferredDemo.js b/components/demo/DeferredDemo.js index ca6cd1c8de..eca8263ae0 100644 --- a/components/demo/DeferredDemo.js +++ b/components/demo/DeferredDemo.js @@ -1,4 +1,4 @@ -import { useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; const DeferredDemo = ({ options, children, onLoad }) => { const [visible, setVisible] = useState(false); @@ -7,7 +7,7 @@ const DeferredDemo = ({ options, children, onLoad }) => { const observerRef = useRef(null); const elementRef = useRef(null); - /*useEffect(() => { + useEffect(() => { const handleIntersection = ([entry]) => { clearTimeout(timeoutRef.current); @@ -33,7 +33,7 @@ const DeferredDemo = ({ options, children, onLoad }) => { clearTimeout(timeoutRef.current); }; - }, [visible, onLoad, options]);*/ + }, [visible, onLoad, options]); return ( <>