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

147
Vistas
Render multiple elements in React Router v6.+

I need the answer to this question: Render multiple components in React Router but for the newer version of react-router-dom (I'm using v6.0.2)

the older version of router-dom would work like this:

<Route path="/">
 <Header/>
 <Home/>
</Route>

while the new one looks like this:

<Route exact path="/" element={<Home/>}/>

I'm not sure how to add the Header as well

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try wrap them in a fragment

<Route exact path="/" element={<><Header/><Home/></>}/>
about 4 years ago · Juan Pablo Isaza Denunciar

0

I ran in to the same issue, but also needed one page to get data from the parent element.

<Route path="/" element={<><Header/><Home children={<HomeDataProvider/>}/></>} />
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