I am using the Functional component for React Project. I like to add functionality like <prompt />
that is if the user accidentally presses the refresh, or back button or changes the URL, and many more than one alert box appears. But I can not use the <prompt />
tag in my project because it is not available in "react-router-dom": "^6.3.0".
Asked
Active
Viewed 1,234 times
-1

Vishnu Kumar
- 1
- 4
-
Does something like this help answer your question? https://stackoverflow.com/a/68933242/8690857 – Drew Reese Jun 20 '22 at 19:57
1 Answers
0
This alternative approach to do that, useeffect and browser back button method to do apply your prompt code.

Meet Majevadiya
- 355
- 2
- 8
-
For the form in react, I used Formik. To know whether the form is durty or submitter ((formik.dirty && formik.isValid) || formik.isSubmitting) Can u show me the demo code? It would be very helpful for me. – Vishnu Kumar Jun 19 '22 at 03:11