1
1
12332112020-07-17 22:32:51
React
1233211, 2020-07-17 22:32:51

How to output all photos from a folder to a specific div on the page?

There are photos in the folder, how can I make these pictures appear in the block? It is necessary that it be possible to add/remove photos from the folder and nothing breaks, if a picture is added to the folder, it should be displayed in the block.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McBernar, 2020-07-17
@McBernar

You don't have access to the folder from react.
You can make a json file, where to write the file names, and in react access this file, pass through it with a map, take the file names and render pictures.
But here you have to not only upload files to the folder, but also edit json. Although this, of course, is much easier than rebuilding the react project every time and pushing it to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question