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

302
Views
× ReferenceError: Home is not defined

I wanted to import react router to my components and got the error as described in the 'title'!

btw I'm doing it from a tutorial crash course!

I will show my files below

App.js

import { BrowserRouter, Route } from "react-router-dom";
import "./App.css";
import Header from "./components/Header";
import Home from "./Pages/Home";
import About from "./Pages/About";
import Profile from "./Pages/Profile";


function App() {
return (
<BrowserRouter>
  <div className="App">
    <Header />
  </div>
  <Route path="/" component={Home} exact />
  <Route path="/about" component={About} /> 
  <Route path="/profile" component={Profile} />
</BrowserRouter>
);
}
export default App;

Home.js

const Home = () => {
return <h1>Home Page</h1>;
};

export default Home;

About.js

const About = () => {
return <h1>About Page</h1>;
};

export default About;

Profile.js

const Profile = () => {
return <h1>Profile Page</h1>;
};

export default Profile;

Header.js

const Header = () => {
return (
    <>
        <h1>React Router Dom</h1>
    </>
)
}

export default Header;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Are you sure that it is in "./Pages/Home" ? Can you try putting Home component code above

function App()

to see if it will show the same error

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!