score:2

Accepted answer

require is used to import javascript code. you probably want something like:

<img src="/images/profilepic.jpg" align="middle"/>

which would read from your public images folder. looking more closely at your terminal i see you have your images inside the components folder. usually you want to have some images / other assets folder inside a public directory apart from your javascript components.

webpack will compile all the code into a bundle, and your webserver will expose the public files under the root directory.

see webpack publicpath config options for more info.


Related Query

More Query from same tag