Closed shairez closed 2 years ago
I don't think <RouterOutlet>
is correct. You would expect that you would have exactly one <RouterOutlet>
but you will actually have one for each layout component.
So you're saying that for each nested layout we would have to add a nested <RouterOutlet>
?
Isn't that the same concept as having nested routes and nested outlets accordingly like in client-side frameworks?
I hate to be the guy who is given two choices and picks 3 (especially when I suggested one of the two choices) but I have some more thoughts on this.
RouterOutlet
feels off because it is so tied to client-side, SPA routing in my mind.
Page
feels more comfortable to me, but I agree that it's incomplete because it's ignoring the idea of layouts.
My understanding of what Qwik City is doing is:
page
(.tsx/.mdx) element, it walks up the directory tree, gathering all the layouts along the way.Content
component, as it's named now, is the very top of that collection, where the end result is flattened out and rendered.So, here's my suggested compromise: <Route/>
I like it because it's:
Curious about everyone's thoughts.
Layouts dont use RouterOutlet, or Content, just Slot, whatever this API is named, itβs using a single time to indicate where the routers will renders the layouts and page
I think <RouterOutlet/>
describes what it is, and a page would only have 1. Layouts on the other hand are just normal qwik components, and use the existing <Slot/>
component for content projection.
Is your feature request related to a problem?
Currently the component
<Content/>
that renders the_layout
+ page has a name that is too generic and doesn't really reveal the "magic" that goes behind the scenes.Describe the solution you'd like
Because what's happening behind the scenes is that QwikCity uses the router info to know which files to render
We discussed 2 possible alternative names:
<RouterOutlet/>
<Page/>
Describe alternatives you've considered
described above
Additional context
We would like to open it for a vote:
π for
<RouterOutlet/>
π for<Page/>
Please use the emoji of the name you prefer