title: React.js won't load a local file, passin background image style attribute as a prop
body: <p>I'm trying to pass <code>style</code> attribute as a prop when rendering a component I've made. When I pass a local image as <code>background: </code> it won't load, but if it is an image address it loads as it should. <a href="https://i.stack.imgur.com/YqB1v.png" rel="nofollow noreferrer">Here is the folder structure</a>.</p>
  <p>Here is the how I'm passing the prop:</p>
  <pre class="lang-css prettyprint-override"><code>      &lt;Key
          style={{
            background: require(&quot;./keyImages/0.jpeg&quot;),
            backgroundSize: &quot;70px&quot;,
          }}
        /&gt;
  </code></pre>
  <p>Thanks a lot in advance for help!</p>