statically rendering my pages
Answered
Alligator mississippiensis posted this in #help-forum
Alligator mississippiensisOP
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
@aardani whats your build log?
Alligator mississippiensisOP
all static pages
it has those circles
@Alligator mississippiensis 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
@Alligator mississippiensis 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
Alligator mississippiensisOP
is there a way to fix this?
@Alligator mississippiensis is there a way to fix this?
use only one root layout
Answer
@joulev use only one root layout
Alligator mississippiensisOP
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
Alligator mississippiensisOP
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