Display images in React using JSX without import
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The problem i face is with img tag. When a single is concerned, The below code loads the image: import image1 from './images/image1.jpg; <img src={image1} /> But the below code doesn't load: <img src={'./images/image1.jpg'}/> or <img src='./images/image1.jpg'/> I need to loop through json , something like [{'img':'./images/image1.jpg','name':'AAA'},{'img':'./images/image2.jpg','name':'BBB'}] and display each of them as image with name as footer. Looping is fine but images doesn't load.It is not actually possible for myself to import every