DEV Community

Discussion on: Detecting user leaving page with react-router-dom v6.0.2

Collapse
 
proddy profile image
Proddy

Thanks Muhammad for this post. I've been after a nifty solution for this.

One enhancement would be to check if the form value has actually changed, before triggering the dialog? This would mean comparing values in handleChange() and keeping the original form values/states. Any ideas how to implement this?