Slight delay is needed

pull/475/head
Lim Chee Aun 2024-04-03 16:06:37 +08:00
rodzic ebd9f05f69
commit 989e788d8e
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
/*
Rendered but hidden. Only show when visible
*/
import { useLayoutEffect, useRef, useState } from 'preact/hooks';
import { useEffect, useRef, useState } from 'preact/hooks';
import { useInView } from 'react-intersection-observer';
// The sticky header, usually at the top
@ -26,7 +26,7 @@ export default function LazyShazam({ children }) {
skip: visibleStart || visible,
});
useLayoutEffect(() => {
useEffect(() => {
if (!containerRef.current) return;
const rect = containerRef.current.getBoundingClientRect();
if (rect.bottom > TOP) {