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

152
Vistas
How to Prevent App Reload using ReactRouter v6 while switching to different route patterns?

In my ReactJs project I have implemented ReactRouter V6 there are multiple routes setup for the application for example I have following routes:

<Routes>
  <Route path="/welcome" element={<SingleArticleById layout={"docs"} articleId={47} />} /> 
  <Route path="/documentation/api/introduction/:endpoint/:articleSlug" element={<Article />} />
  <Route path="/documentation/api/:endpoint/:path" element={<SwaggerArticle />} />
  <Route path="/documentation/:sectionSlug/:articleSlug" element={<Article />} />
</Routes>

the application works fine if you remain in similar route pattern such as

/documentation/api/introduction/:endpoint/:articleSlug

but when you navigate to a different route pattern full application is reloaded as if its a fresh redirect to the application by browser and not navigated by react-router.

similarly if you keep browsing in

/documentation/:sectionSlug/:articleSlug

the application works fine, but when you go to different route pattern the app reloads.

please suggest a solution about this.

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