Next.js Discord

Discord Forum

statically rendering my pages

Answered
astro posted this in #help-forum
Open in Discord
i have a website: https://trackker-io.vercel.app. if u navigate to /dashboard using get started button or navigate to the homepage by clicking the logo it'll cause the site to load even tho im using only one client component(/components/Navbar.tsx) that too only on /dashboard and /profile, please have a look at my code: https://github.com/777advait/trackker

is this happening because im using route groups
Answered by joulev
use only one root layout
View full answer

18 Replies

@ᴉuɐpɹɐɐ whats your build log?
all static pages
it has those circles
@astro all static pages
if u navigate to /dashboard using get started button or navigate to the homepage by clicking the logo it'll cause the site to load even tho im using only one client
Sounds normal to me
any route change will definetly hit the server in Next.js
if the page is alr rendered on the server it should reload the whole page when i navigate
Navigating between root layouts means navigating between separate react roots, requiring full page reload
This doesn’t depend on static rendering or dynamic rendering
@astro is there a way to fix this?
use only one root layout
Answer
@joulev use only one root layout
i added one more layout in the root and now it works fine
in simple words im using 3 layouts
correct. the layout in the root becomes the new root layout while your two former root layouts are no longer root layouts, they are normal layouts now
just that its not the root layout for that page right
yes they are normal layouts not root layouts