Answer the question
In order to leave comments, you need to log in
Why can't I see the image in the React component?
And so, this structure:
-public
--index.html
-src
--components
---myComp.js
--files
---n-logo.js
<img src="../files/n-logo.svg" alt=""/>
<img src="/src/files/n-logo.svg" alt=""/>
- absolute path, also not Answer the question
In order to leave comments, you need to log in
You should not specify the path in the file system, but the URL relative to the folder that you have webroot. Wang that this is public. Those. you need to put the image in public and specify the URL there.
In my project, all files are in public and I specify the path to the files './files'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question