I've got a trouble with display images on react page. I have directory with 30 images and I would like to display them on page (.jsx file). I know that I can export every single image, but I'm looking for much faster way to do this. Have you any ideas how to help me?:
dir structure:
_|app
_|src
___|images(there are images)
___|components
______|gallery.jsx
_|App.js
_|index.js
I tried to use insertAdjacentHTML function like in plain html/js page but I don't have idea how to convert that code to react where I need get div ID to insert that with loop.
If you are using Create React App, there is an option for public folder.
you put a file into the public folder, it will not be processed by webpack. Instead it will be copied into the build folder untouched. To reference assets in the public folder, you need to use an environment variable called PUBLIC_URL.