---
export interface Props {
images?: string[]; // Accept an array of image URLs
}
const { images } = Astro.props;
const renderImages = (imageUrls: string[]) => {
return imageUrls.map(imgUrl => (
<li>
<img src={imgUrl} />
</li>
));
};
---
<section>
<ul>
{renderImages(images)}
</ul>
</section>
#How to add images recursively without framework?
5 messages · Page 1 of 1 (latest)
---
export interface Props {
images?: string[]; // Accept an array of image URLs
}
const { images } = Astro.props;
---
<section>
<ul>
{images.map(url=> <li><img src={url}></li>)}
</ul>
</section>
Thank you very much for Correct Solution 🆗