My website uses a full screen popup for the navigation. (Currently I'm using ReactModal but I had the same issue with a home-made modal component I was previously using). When a user clicks a link in the navigation using the NextJS Link component, the popup doesn't automatically close—they have to close it manually to show the new page. I made an onClick event to close the navigation popup, but there is often a brief moment after the nav closes and before the next page loads which is confusing to the user.
I think the issue is that when the app updates to the new page, it doesn't re-mount the navigation component, so the nav component keeps the "open" state.
Is there a way to make it close the popup at the moment that the next page has loaded? Or maybe there is a more elegant solution to this that I'm not thinking of.