I am working on a react spa to show alert on unsaved form changes. I am using React-router-dom@5.2.0 Prompt Component for this use-case.
The page which has the form also has an iframe. The problem is when the user fills in the form but doesn't save it and tries to navigate using the browser-back button, the alert is shown and if the user cancels the navigation, the iframe unload/load fires even though the page itself didn't unmount/mount. This leads to the iframe losing its state
from React-router-dom Prompt: Iframe within a page gets unloaded/loaded
No comments:
Post a Comment