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 ( <>