I've got a clean create-react-app install and I wanted to add my own svg image to show, the same way that logo is shown i.e.:
import logo from './logo.svg';
{logo}
However when I import my own svg the same way as logo is imported and try to use it, it prints a url like this on the screen:
/static/media/menu.92677579.svg
instead or rendering the image, could someone help me figure this out please?
When you write {logo}
you're just embedding a URL.
If you want to show an image, use the <img>
tag like the default template does.
<img src={logo} alt="My logo" />
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With