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

99
Views
react-router content don't show on screen until refresh

hey I have a react application and I add a navigation bar but I have a problem with the react-router: when the "about" Link gets pressed the URL is changing to /about but the screen is not changing until I refresh the page how can I fix it?

code (navigation.js):

import { Link } from 'react-router-dom';

<Nav fill variant="tabs" defaultActiveKey="/home">
  <Nav.Item>
    <Nav.Link>
      <Link to="/" style={{ textDecoration: 'none' }}>Home</Link>
      </Nav.Link>
  </Nav.Item>
  <Nav.Item>
    <Nav.Link eventKey="link-1">
    <Link to="/about" style={{ textDecoration: 'none' }}>About</Link>
      </Nav.Link>
  </Nav.Item>
  <Nav.Item>
    <Nav.Link eventKey="link-2">
    <Link to="/contact" style={{ textDecoration: 'none' }}>Contact</Link>
      </Nav.Link>
  </Nav.Item>
  <Nav.Item>
    <Nav.Link eventKey="disabled" disabled>
    School
    <br />
     Chat
    </Nav.Link>
  </Nav.Item>
</Nav>

code (app.js):

import { BrowserRouter as Router, Route, Switch } from "react-router-dom";

        <Router>
         <div className="App">
            <Navigation />
                <Switch>
                    <Route exact path="/">
                        <HomeScreen />
                    </Route>
                    <Route path="/about">
                        <About />
                    </Route>
                    <Route path="/contact">
                        <Contact />
                    </Route>
                </Switch>
         </div>
         </Router>
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!