revert unneeded changes

re-rendering was caused by the overlay state hook, not this one
This commit is contained in:
Josh Hawkins 2026-03-06 06:47:31 -06:00
parent adbc4bd71c
commit e10ea2e071

View File

@ -1,4 +1,4 @@
import { useCallback, useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
const useImageLoaded = (): [ const useImageLoaded = (): [
React.RefObject<HTMLImageElement | null>, React.RefObject<HTMLImageElement | null>,
@ -8,15 +8,15 @@ const useImageLoaded = (): [
const [loaded, setLoaded] = useState(false); const [loaded, setLoaded] = useState(false);
const ref = useRef<HTMLImageElement>(null); const ref = useRef<HTMLImageElement>(null);
const onLoad = useCallback(() => { const onLoad = () => {
setLoaded(true); setLoaded(true);
}, []); };
useEffect(() => { useEffect(() => {
if (ref.current?.complete) { if (ref.current && ref.current?.complete) {
onLoad(); onLoad();
} }
}, [onLoad]); });
return [ref, loaded, onLoad]; return [ref, loaded, onLoad];
}; };