-1

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".

1 Answers1

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