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

185
Views
React Router Link URL changing but at the same time the Component Not Rendering
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Nav from "./Nav";
import Home from "./Home";
import About from "./About";

export default function App() {
    return (
        <>
            <Router>
                <Nav />
                <Switch>
                    <Route path="/" component={Home} />

                    <Route path="/about" component={About} />
                </Switch>
            </Router>
        </>
    );
}

I am using react-router-dom in my project and I am facing unusual behavior. when I use Link to perform navigation, the URL changes but the component is not rendered. and if I try to refresh the page at that point the component gets loaded. ( react-router-dom v5.2.0 )

import { Link } from "react-router-dom";
export default function Nav() {
    return (
        <nav>
            <ul>
                <li>
                    <Link to="/">Home</Link>
                </li>
                <li>
                    <Link to="/about">About</Link>
                </li>
            </ul>
        </nav>
    );
}
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!