2022-10-08から1日間の記事一覧
useEffect(() => { setTimeout(() => { // preload const img = new Image(); img.src = image; // setLoaded to true on load and display image img.onload = () => { setLoaded(true); }; }, (idx + 1) * 300); }, []); ... loaded ? ( // display image )