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

175
Vistas
Prevent user from leaving view if there are unsaved changes without using routes in React

I have a panel that opens like a modal from right to left. Inside the panel I have a left navigation with different options that when clicking render different components.

These components are forms and I wanna prompt the user if he navigates away from a component while having unsaved changes.

I cannot use react routes since I have no routes for these, theyre just components.

Is there a way so that I cant prevent the user from navigating away or from unmounting the component and display that popup?

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

0

If it is an input you can use onBlur

or onMouseLeave if the mouse leave the component

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