title: Where should I put images files in React project?
body: <p>I usually make images folder under src folder, so I access them through require <code>require("images/sample.jpg")</code> in my components.</p>
  
  <p>My friend who's learning React was struggling to load images and he made images folder under public like the below image. With that, he can access images without <code>require()</code>, so he just does <code>images/sample.jpg</code>. I thought I had it's required to use <code>require()</code> to load images in React.</p>
  
  <p>Is there no problem to put images folder under public? then why should we use <code>require()</code>?</p>
  
  <p><a href="https://i.stack.imgur.com/XXzGF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XXzGF.png" alt="enter image description here"></a></p>