I made a date picker in response and I try to load it into NPM and it uses external svg, but I am having problems with the correct link to this svg.
So my file directory is as follows:
+
| +
+
| +
| +
Then in Datepicker.jsx I have
<object style={STYLES.arrow} data="../imgs/arrow.svg" type="image/svg+xml" />
But then when I install it through npm and try to use it in the project, it says:
GET http://localhost:8000/imgs/arrow.svg 404 (Not Found)
It looks like it is looking for the imgs directory in the root of the project, and not in the module itself, but I'm not sure how to fix it.
source
share