Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

141
Visualizações
react gives me a blank page

i'm working on some react projects and i've tried to orginize my code by moving some components to another files then import them but when i do that it just give me a blank page , when i write (import Header from "./Header") it starts to give blank page while it was working when i was putting all of the code in index.js only . this is my main index code:

import Header from "./Header"
import Footer from "./Footer"
import Maincontent from "./Main"

function Page(){
    return(
        <div>
        <Header />
        <Maincontent/>
        <Footer />
        </div>
    )
}

ReactDOM.render(<Page/>, document.getElementById("root"))

and this is my header code

export default function Header(){
    return(
    <header>
        <nav className="nav">
            <img src="./react-logo.png" className="img" />
            <ul className="nav-items">
                <li> Pricing </li>
                <li> About </li>
                <li> Contact </li>
            </ul>
        </nav>
    </header>
    )
}


about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to export Header. Try putting export default Header at the bottom of your Header component file.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda