When user presses reload btn in browser, the handler is fired but the page then gets refreshed. We need to prevent the default event here -
|
if (desktop?.useBeforeUnload) { |
Reference - https://github.com/streamich/react-use/blob/e1d0cd9f7fb2a124a9d46879489abfefdf48d836/src/useBeforeUnload.ts#L13C7-L13C29