I am following this guide for ReactJS and ran into the aforementioned error while using an Img tag as designated by the guide.
<Img src={keepLogo} alt="Google keep logo" />
Leads to this error:
Warning: Invalid value for prop `src` on <img> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM.
How am I able to link the source to react-icons? And why does the source not work.
Here is my code:
import React from 'react'
import styled from 'styled-components';
import { DiFirebase, DiGoogleDrive, DiReact } from 'react-icons/di';
const Nav = styled.nav`
display: flex;
justify-content: space-between;
align-items: center;
padding: 4px 25px;
border-bottom: 1px solid rgba(60, 64, 67, 0.2);
`;
const ImgWrap = styled.div`
display: flex;
align-items: center;
`;
const Img = styled.img`
width: 40px;
height: 40px;
`
const Header = () => {
return (
<Nav>
<h1>Keep clone</h1>
<ImgWrap>
<Img src={DiGoogleDrive} alt="Google keep logo" />
<p>+</p>
<Img src={DiReact} alt="React logo"/>
<p>+</p>
<Img src={DiFirebase} alt="firebase logo"/>
</ImgWrap>
</Nav>
)
}
export default Header