Next.js Discord

Discord Forum

Show a warning if user tries to close, reload or navigate somewhere else

Unanswered
Naeemgg posted this in #help-forum
Open in Discord
Avatar
Hi, guys I have a page where the user needs to click on the save button before leaving to save data in DB, I was wondering if there's any way we can put some kind of warning like we get when leaving or reloading a form. I just need to show user a warning if they try to close the tab/ reload the page or try to navigate somewhere else

3 Replies

Avatar
Image
a warning like this