In my project, the navbar template is in the scr/components/NavBar/index.js folder and the logo is in the scr/img/logo.svg folder, but even with the correct path it is not finding? folder structure:
the logo search is in the tag:
<NavLogo to="/">
<img src={require('../../img/logo.svg')} alt="logo"/>
</NavLogo>
import React, { Component } from "react";
import { FaBars } from 'react-icons/fa'
import {Nav,
NavbarContainer,
NavLogo,
NavMenu,
NavItem,
NavLinks,
MobileIcon
} from './NavbarComp.js';
export default class NavbarComp extends Component {
render () {
return (
<div>
<Nav>
<NavbarContainer>
<NavLogo to="/">
<img src={require('../../img/logo.svg')} alt="logo"/>
</NavLogo>
<MobileIcon>
<FaBars />
</MobileIcon>
<NavMenu>
<NavItem>
<NavLinks to="home">Home</NavLinks>
<NavLinks to="about">Sobre Nós</NavLinks>
<NavLinks to="services">Serviços</NavLinks>
<NavLinks to="partner">Parceiros</NavLinks>
<NavLinks to="contact">Contato</NavLinks>
</NavItem>
</NavMenu>
</NavbarContainer>
</Nav>
</div>
);
}
}