Skip to content

Commit

Permalink
fix: useElementLazyRender
Browse files Browse the repository at this point in the history
  • Loading branch information
chaishi committed Nov 19, 2023
1 parent c55e6a5 commit e9dee6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useElementLazyRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import observe from '../_common/js/utils/observe';

export function useElementLazyRender(labelRef: MutableRefObject<HTMLElement>, lazyLoad: boolean) {
const ioObserver = useRef<IntersectionObserver>();
const [showElement, setShowElement] = useState(true);
const [showElement, setShowElement] = useState(!lazyLoad);

const handleLazyLoad = () => {
if (!lazyLoad || !labelRef.current || ioObserver.current) return;
Expand Down

0 comments on commit e9dee6e

Please sign in to comment.