populating an image from local computer to react js code example
Example 1: how to load the images from the website dynamically in react
const images = require.context('../../public/images', true);
// adding dynamic paths
let dynamicImage = images(`./${someVariable}.png`);
// static image
let staticImage = images('./image.png');
Example 2: showing an image in react js
import image from './path-to-image';
<img src={image} height={100} width={100} />