Persist query data in navbar for particular pages
I think this is more of a Nextjs question, but I created a DashboardLayout for all of my sub pages in /dashboard. In the DashboardLayout component is a navbar that has the title fetched from my useDashboard hook. How do I persist the title when changing pages, as right now when I do it will refetch and so for a brief moment is blank.
1 Reply
stormy-goldOP•3y ago
So, I've been putting DashboardLayout in all my pages, when I should have put it in my _app.js. It's working as expected. Although I'm running into a lot of conditional pathing from my protected and unprotected routes and other layouts. I don't know if that's an okay thing. If anyone knows a better way to handle a bunch of conditional providers in my _app.js I'm more than happy to listen.