From da9e958d9408843ab56993eae425947e3515d141 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sun, 18 Feb 2024 23:22:09 +1030 Subject: [PATCH] fix(carousel-image): preload images --- src/components/ImageCarousel.tsx | 39 +++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/components/ImageCarousel.tsx b/src/components/ImageCarousel.tsx index 38b425a5..3e0a0eea 100644 --- a/src/components/ImageCarousel.tsx +++ b/src/components/ImageCarousel.tsx @@ -31,18 +31,31 @@ export default function ImageCarousel({ images, width, height }: ImageCarouselPr }); return ( -
- {images[currentImageIndex].alt} -
+ <> + {images.map((image, i) => ( + {image.alt} + ))} +
+ {images[currentImageIndex].alt} +
+ ); }