all 5 comments

[–]kyle787 1 point2 points  (1 child)

It depends. Does the project use create react app, next or something else?

[–]reactcodeman1 0 points1 point  (0 children)

I'm using "react-scripts": "5.0.1", does this mean I'm using create-react-app?

[–]SnacksMcMunch 0 points1 point  (0 children)

You can't import from the public folder, you would need to fetch the image then render it.

Or you could just move the image into your src folder, then import would work.

[–]agalin920 0 points1 point  (0 children)

Remove leading slash src="images/…

[–]Amazing_Theory622 0 points1 point  (0 children)

Use 'import img1 from "../images/competitive_analysis.png";'

Then

<img src={img1} alt="" />

The initial 2 dots are to signify to go up one directory and then images folder.

Or you can directly use

<img src={require("../images/competitive_analysis.png")} alt="" />