From 989e788d8e650e9ec8e250d1053de6139d373e40 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Wed, 3 Apr 2024 16:06:37 +0800
Subject: [PATCH] Slight delay is needed

---
 src/components/lazy-shazam.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/components/lazy-shazam.jsx b/src/components/lazy-shazam.jsx
index e340f276..3eea4808 100644
--- a/src/components/lazy-shazam.jsx
+++ b/src/components/lazy-shazam.jsx
@@ -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) {