Answers for "how to load the images from the website dynamically in react"

-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');
Posted by: Guest on May-18-2020

Code answers related to "how to load the images from the website dynamically in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language