I have an issue where I don't understand what I'm doing wrong. I'm passing array of strings (URLs) to a component and try render Images from those URLs by using the map function but what I'm doing seems to break the array.
function Board(props) {
let images = props.images.map((imgUrl, index) => {
return <img key={index} src={imgUrl} alt="img"></img>;
});
console.log(images);
return (
<div className="Board">
<p>Board</p>
{images}
</div>
);
}
I'm probably missing something obvious so thanks in advance
props.imagesit matches the following format?:['example.com/image.jpg', ...]? it seems weird that youimagesarray would be empty ifprops.imageswas not emptyimagesarray and why would you do that?