Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!