Nested Layouts - Confused about consistency of "eager" rendering when done conditionally #61427
Unanswered
csi-lk
asked this question in
App Router
Replies: 1 comment
-
Wondering if I can bump this as it's been a while without response |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hit an interesting piece of functionality with the App Renderer I'm looking for clarification on
Context: We have a requirement for turning on and off routes with conditional logic (in our case feature flags but this part shouldn't matter)
In the docs it gives a specific example on Conditional Routing with
@slots
, which makes sense, the part I'm confused by is that in the example provided of:Both the
user
andadmin
@slot
spage
s are rendered on the server regardless of the conditional, including any server side logic (eg. makingfetch
calls for their respective data).I assume next is eagerly rendering both pages on the server for speed of delivery, there's an issue here around making fetch calls when not required, but at the end of the day the rendered component going to the user is correct.
My question is, If I setup an app with
The root
layout.tsx
hasand each slot
layout
/page
is a straightforward with aconsole.log
of what is runningI get the output from cold boot:
Image of setup / for more clarity: image
My confusion is that:
layout @one
doesn't get called for rendering (or, at least, doesn't trigger theconsole.log
), am I missing something obvious here?Any guidance would be helpful
(I've run it many times in case there's a race condition here I'm missing)
Beta Was this translation helpful? Give feedback.
All reactions