Clarifying valid ways to manage HTML head in App Router #80725
Replies: 1 comment 3 replies
-
1. Is manually coding the
|
Beta Was this translation helpful? Give feedback.
-
1. Is manually coding the
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From reading Next.js App Router docs, I have the impression that we need to use Metadata APIs and perhaps the Script component (e.g.,
beforeInteractive
) for updating what ends up in the HTMLhead
element.On the other hand, I also see some examples that show
head
in the Root Layoutsrc/app/layout.tsx
.Is manually coding the
head
element insrc/app/layout.tsx
valid / supported by Next.js? Or are these examples out of date?If it's valid, is there any guarantee on the order elements get added to the
head
in relation to what was manually coded?Clarifications / answers here may also help answer #75469.
Thanks for any insights.
Beta Was this translation helpful? Give feedback.
All reactions