This lets people use Remix's Layout export without it affecting the Head export. Because the hack includes changing the Head export to default, Layout gets applied to Head, which results in wrapping Layout around the Head during SSR 😬 (renderHeadToString)
This fix excludes the Layout export from root route module exports in remixContext during SSR.
I'm aware that there might not be much interest in maintaining this library anymore for various reasons, one being that React v19 feels right around the corner. But until then it isn't here yet 😄
If someone stumbles upon this unmerged, you can easily modify the remixContext that you're passing to renderHeadToString in entry.server.ts to omit Layout just like in this diff.
I bumped development dependencies because this library has been built for Remix v1, and Layout export has been released in v2. Let me need if I need to walk any updates back.
This lets people use Remix's
Layout
export without it affecting theHead
export. Because the hack includes changing theHead
export todefault
,Layout
gets applied toHead
, which results in wrappingLayout
around theHead
during SSR 😬 (renderHeadToString
)This fix excludes the
Layout
export from root route module exports inremixContext
during SSR.I'm aware that there might not be much interest in maintaining this library anymore for various reasons, one being that React v19 feels right around the corner. But until then it isn't here yet 😄
If someone stumbles upon this unmerged, you can easily modify the
remixContext
that you're passing torenderHeadToString
inentry.server.ts
to omitLayout
just like in this diff.I bumped development dependencies because this library has been built for Remix v1, and
Layout
export has been released in v2. Let me need if I need to walk any updates back.Fixes #15