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)

AWS Industries LIVE! Stream

Business benefits of the cloud

Join AWS experts and tech leaders as they discuss the business impact of the cloud on Industries LIVE!

Learn More

Retry later