Skip to content
Advertisement

Local image show not show up in React JS

I’m just learning about React JS and Material UI to create a dynamic web application. I’m using ‘url(${process.env.PUBLIC_URL})’ to connect my local image but for unknown reason the image would not show up.

enter image description here

As displayed above, I’m trying to place the water-bottle.jpg image inside AboutUs.js file but the error is constantly saying ‘GET http://localhost:3001/images/water-bottle.jpg 500 (Internal Server Error)’.

This is the file structure in AboutUs.js:

JavaScript

Advertisement

Answer

You can try this

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement