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

98
Vistas
Reactjs screen is not rendering

I think that the problem is in the switch, in version of react-router-dom or in routes. Only when I created and applied the code in this class, the screen started don't render and stays white. I already changed the version of react-router-dom but I don't know what can be. Below the code of routes.js:

//react-router-dom version: "^5.3.0"
import {BrowserRouter, Route, Switch} from 'react-router-dom';
import Home from './pages/Home';
import Header from './components/Header';

const Routes = () => {
    return(
        <BrowserRouter>
            <Header/>
            <Switch>
                <Route exact path="/" component={Home}/>
            </Switch>
        </BrowserRouter>
    )
}

export default Routes;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

React Router v6 introduces some changes like.

Routes component that is kind of like Switch, but a lot more powerful one.

Route still exist but you don't pass a pointer to that component function or as a children component, Instead you pass the JSX element to the element prop & exact doesn't exist anymore, now it's always looks for exact matches.

So, component={Home} would become element={<Home />}

Something like this

<Routes>
    <Route path="/" element={<Home />} />
    <Route path="about" element={<About />} />
</Routes> 

You can dive deep to this migration guide: https://reactrouter.com/docs/en/v6/upgrading/v5

hope that's help you

about 4 years ago · Juan Pablo Isaza Denunciar
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