DEV Community

Shishir Bhuiyan
Shishir Bhuiyan

Posted on

Answer: ReactJS and images in public folder

You don't need any webpack configuration for this.
<img src="/image.jpg" alt="image" />

To reference images in public there are two ways I know how to do it straight forward.
<img src={process.env.PUBLIC_URL + '/yourPathHere.jpg'} />

Reference : https://stackoverflow.com/questions/47196800/reactjs-and-images-in-public-folder

Top comments (0)