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

177
Views
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 answers
Answer question

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 Report
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!