Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Cambiar la ruta al actualizar el navegador

Tengo un escenario cuando el usuario hace clic en la actualización del navegador, se debe cambiar el enrutamiento de la página. Intenté usar el siguiente código durante la fase de montaje/desmontaje, pero no tuve suerte.

 useEffect(()=>{ window.addEventListiner("beforeUnload", changeRoute); return()=>{ window.removeEventListiner("beforeUnload", changeRoute); } },[]) const changeRoute = (e) =>{ e.prevantDefault(); pros.history.push('/somepage'); }

Con este código, puedo ver que la URL está cambiando a '/ alguna página' y volviendo a navegar a la misma página nuevamente. No se está moviendo a '/ alguna página'. ¿Alguien me puede aconsejar por favor?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!