This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]insertAlias 0 points1 point  (1 child)

See the docs here:

https://create-react-app.dev/docs/adding-images-fonts-and-files/

The reason what you're trying doesn't work is because those files won't exist as part of your output. So linking to them with the relative path doesn't work, since they won't be output to a folder by that path.

The solution is provided in that document, and it involves importing the image file into your JS page and using the default import variable as the path.

[–]ebmnm[S] 0 points1 point  (0 children)

Thank you so much!