Is there an officially supported way I can prevent a user from navigating away from a page (ie, "this page contains a half-filled out form, are you sure you want to navigate away?") Ideally something like react-router's <Prompt> component, but obviously since Gatsby v2 uses reach router that won't work. I had a look at reach's docs and couldn't see any reference to it.
Thanks very much!
See the third bullet point in tradeoffs https://reach.tech/router/credits
I assume this is within the site?
Ah thanks, I missed that. Yeah I primarily meant navigation within the site.
Reading that link, I think I'm convinced that just using session storage would cover my use-case fine, so I'll close this. Thanks for the help!
So is it impossible to block page reload in gatsby? Say i have a quiz app i don't what people to move away from the page until the finish or the time is up. How do i prevent navigating away from this page?
Most helpful comment
So is it impossible to block page reload in gatsby? Say i have a quiz app i don't what people to move away from the page until the finish or the time is up. How do i prevent navigating away from this page?