How to reference image in React Component NPM module?
<p>I have made a date picker in react and I am trying to upload it to NPM, and it uses an external svg, but I am having trouble correctly referencing that svg.</p>

<p>So my file directory looks like this:</p>

<pre><code>+-- imgs
|   +-- arrow.svg
+-- src
|   +-- Datepicker.jsx
|   +-- index.js
</code></pre>

<p>Then in Datepicker.jsx I have<br>
<code>&lt;object style={STYLES.arrow} data="../imgs/arrow.svg" type="image/svg+xml" /&gt;
</code></p>

<p>But then when I install it through npm and try to use it in a project, it says:<br>
<code>GET http://localhost:8000/imgs/arrow.svg 404 (Not Found)</code></p>

<p>It looks like it is looking for the imgs directory in the root of the project instead of in the module itself, but I'm not sure how to fix this.</p>