SVG not rendering

What am I missing?

I have the following:

import logo from './mtntpcdng_lg.svg'

... more code

<img src={logo} alt="My Logo" />

... more code

However, when I run yarn rw dev I just get the logo’s alt text and not the logo. The logo is located in the same directory as the component. Link to the full code…

I found this older post here and gave it a try as well but it did not work… :persevere:

https://dreamy-goodall-2cceac.netlify.app/

Hi @IsaacT8, welcome to the community :slight_smile:

So you did try this?

import Logo from './mtntpcdng_lg.svg'

<Logo />

Notice the capital L. It’s what I do, and it works for me

1 Like

Thank you!

Whoa, :exploding_head: - the capital L did the trick. :laughing:

Nice! Yeah, it’s a general rule for React components - they have to start with a capital letter.

Thank you for mentioning that - I had forgotten. Gotta brush up my React skills a bit :laughing: