Good afternoon, I am trying to create a React (static) application, made of only on client-side. I do not need server. On client-side there are several images.. I would like to find a way in which the admin of the application is able to load images and to put them into public/img folder of react application. Is it possible to do something like that?
Create an assets folder inside src. That will be the folder where you store the images. See React: Adding Images, Fonts, and Files
/* Component.js */
import React from 'react';
import image from 'PathToAssetsFolder/img.png'; // Tell webpack this JS file uses this image
console.log(image); // PathToAssetsFolder/img.84287d09.png
function Header() {
// Import result is the URL of your image
return <img src={image} alt="Image" />;
}
export default Header;