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

128
Vistas
React routing using react-router-dom v.6 doesn't show anything

so I'm trying to create routing for my react.js app by using react-router v.6. I already tried to do changes for the v.6 but for some reason my app didn't show anything, can anyone help me ?

So Navigation.js file is for Routing, Header.js filled with button for changing route and App.js is used to display them.

App.js:

    <div>
      <Header/>
      <Outlet/>
    </div>

Header.js:

<>
  <Link to="/">Home</Link>
  <Link to="/Productlist">Product</Link>
  <Link to="/Contact">Contact Us</Link>
</>

Navigation.js:

<>
    <Routes>
        <Route exact path="/" element={<Home/>}>
            <Route exact path="ProductList" element={<Product/>}/>
            <Route exact path="ContactUs" element={<Contact/>}/>
        </Route>
    </Routes>
</>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't know if this will solve your problem but first you can start by replacing your Navigation.js by :

<Routes>
    <Route path="/" element={<Home/>} />
    <Route path="ProductList" element={<Product/>}/>
    <Route path="ContactUs" element={<Contact/>}/>
</Routes>

In this case you don't need nested routes.

Then, I don't think it's a good idea to use capitalize letter in path.

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