I have my api which is returning response like this :
"imagePath": "path1",
I have JS code like this below :
<div className="flexAlignCenterJustifyCenter">
{event.imagePath ? (
<img
src={event.imagePath}
onError={(event) => event.target.src = NoImage}
/>
) : (
""
)}
</div>
So properly it is showing the image,
but now I changed my api to give the output as a list which is :
"imagePath": ["path1","path2"]
now the NoImage icon is showing, and I want to display all the images in the list (imagePath) , I am new to javascript can anyone pls help me out?
imagePath.forEach((path)=>{ //you have the image path here })to loop through each path and set them in the image elements.