You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about replacing new Layout export instead of the Document component.
Is it possible to pass some props like forceDark, noIndex from App / ErrorBoundary / HydrateFallback to Layout?
It seems that Layout receive only children as the props, and I want to know how to pass other props.
@Kazuhiro-Mimaki yeah good question. It is not possible to pass in those props, so the logic would have to be reworked a bit.
Thanks for #213, that probably makes more sense as a single PR. I mentioned this to @brophdawg11 as he may want to dogfood the Layout piece, but if you have any ideas for how to rearchitect it feel free to take a stab
IMO the new Layout component is syntactic sugar for common use cases where the "shell" is identical between Component, ErrorBoundary, and/or HydrateFallback. That doesn't mean that every Remix app should definitely use a Layout component.
I'm not familiar with everything that the Document component is doing (yet! I will dig in a bit when I have a sec) but if App/ErrorBoundary have to make enough decisions on their own that drive the Document via props - then composing via Layout may not be the right choice and maybe we just stick with Document.
Another option is whether or not useRouteError can be the thing we fork on to make those decisions in a Layout component.
Vite is stable 🎉
Let's update our packages to the stable version.
Also, let's add the new Layout export instead of the Document component we leveraged instead.
If you want to take this on, feel free to split these 2 PRs if that's easier.
The text was updated successfully, but these errors were encountered: