Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Add My Own Svg Image Just Like Logo Is Shown By Default In Create-React-App

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?

like image 714
linasmnew Avatar asked Feb 17 '17 17:02

linasmnew


1 Answers

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!

like image 80
Dan Abramov Avatar answered Nov 13 '22 06:11

Dan Abramov