nextjs mobile navbar flashes current page before navigating to the next page

so i have a navbar, and on mobile it becomes a full page menu, toggled by a hamburger button. just using a state hook to toggle whether or not i render it. because it's client side rendering and the navbar doesn't rerender, when a user clicks a link i toggle the state and, thus, the navbar disappears. the issue is that because i'm toggling this, the page that the user is currently on flashes quickly before the user is navigated to the next page. my only idea is: don't toggle navbar visibility when the user clicks a link. instead, keep it visible until the user is redirected, share the state between the navbar and each page, and on each page set navbar visibility to false on mount. i feel like this doesn't need to be so complicated, but perhaps this is the best way. any advice appreciated!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server