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

198
Views
React router page is not loading the content without refreshing the page

I am building a multi page react app. When I enter the URL manually everything works, but when I change the page by using Link from react router, even though URL changes, page content stays in main page until I refresh it manually.

Here is my route code.

import Navbar from "./components/navbar/Navbar";
import { Route, Switch } from "react-router-dom";
import MainPage from "./pages/MainPage";
import Places from "./pages/Places";

function App() {
  return (
    <div className="App">
      <Navbar />
      <Switch>
        <Route path="/" exact>
          <MainPage />
        </Route>
        <Route path="/places">
          <Places />
        </Route>
      </Switch>
    </div>
  );
}

export default App;

And my Link elements

<div className={classes['right-buttons']}>
 <ul>
   <li><Link to='/places'>About The City</Link></li>
   <li><Link to='/culture'>Where To See</Link></li>
   <li><Link to='/food'>What To Eat</Link></li>
 </ul>
</div>
about 4 years ago · Juan Pablo Isaza
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!