Next.js Discord

Discord Forum

How do I make an API call when user is about to navigate away to a new route?

Unanswered
Channel catfish posted this in #help-forum
Open in Discord
Channel catfishOP
I want to trigger something like a save session API call right before user is navigating away to a different part of the site. Could be pointing to a button on the parent layout, or sibling tab, or back. Maybe even away to a different site or on refresh. Thanks in advance.

0 Replies