statically rendering my pages
Answered
astro posted this in #help-forum
astroOP
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
is this happening because im using route groups
18 Replies
@ᴉuɐpɹɐɐ whats your build log?
astroOP
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 clientSounds 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
@astro 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
The dashboard and the homepage have two different root layouts so client-side navigation is not possible.
Navigating between root layouts means navigating between separate react roots, requiring full page reload
This doesn’t depend on static rendering or dynamic rendering
@joulev Navigating between root layouts means navigating between separate react roots, requiring full page reload
astroOP
is there a way to fix this?
@astro is there a way to fix this?
use only one root layout
Answer
@joulev use only one root layout
astroOP
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
@joulev 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
astroOP
but the previous two layout are still funtioning
just that its not the root layout for that page right
yes they are normal layouts not root layouts