Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda