Skip to content

Commit 20c76ef

Browse files
committed
feat(next): add head prop to RootLayout
1 parent e0e5174 commit 20c76ef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/next/src/layouts/Root/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const metadata = {
3535
type RootLayoutProps = {
3636
readonly children: React.ReactNode
3737
readonly config: Promise<SanitizedConfig>
38+
readonly head?: React.ReactNode
3839
readonly htmlProps?: React.HtmlHTMLAttributes<HTMLHtmlElement>
3940
readonly importMap: ImportMap
4041
readonly serverFunction: ServerFunctionClient
@@ -43,6 +44,7 @@ type RootLayoutProps = {
4344
export const RootLayout = ({
4445
children,
4546
config: configPromise,
47+
head,
4648
htmlProps,
4749
importMap,
4850
serverFunction,
@@ -52,6 +54,7 @@ export const RootLayout = ({
5254
const content = (
5355
<RootLayoutContent
5456
config={configPromise}
57+
head={head}
5558
htmlProps={htmlProps}
5659
importMap={importMap}
5760
serverFunction={serverFunction}
@@ -70,6 +73,7 @@ export const RootLayout = ({
7073
const RootLayoutContent = async ({
7174
children,
7275
config: configPromise,
76+
head: headFromProps,
7377
htmlProps = {},
7478
importMap,
7579
serverFunction,
@@ -143,6 +147,7 @@ const RootLayoutContent = async ({
143147
>
144148
<head>
145149
<style>{`@layer payload-default, payload;`}</style>
150+
{headFromProps}
146151
</head>
147152
<body>
148153
<RootProvider

0 commit comments

Comments
 (0)