I want to use img src=
to show the image, but eventually failed. I have tried the following methods, but none of these worked:
1.
var logo = require('img/logo.jpg');
...
<img src={logo} alt="" />
2.
import logo from 'style/ydg_logo.jpg';
...
<img src={logo} alt="" />
3.
<img src={require('img/logo.jpg')} alt="" />
Error:
Module not found: Error: Cannot resolve module 'style/ydg_logo.jpg'