I have create react app. In my demo application I manage products and each product has an associated image.
How do I import images of those products which I am going to show?
e.g. I can't do
import cat from './images/cat1.jpg'
import cat2 from './images/cat2.svg'
...
<img src={cat}/>
Because this means I must import ALL images even if I am not displaying them.
How to dynamically import the ones I need?
ps. I found related question but their function shows nothing on my side, maybe because I have create-react-app?