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 HTMLheadelement.On the other hand, I also see some examples that show
headin the Root Layoutsrc/app/layout.tsx.Is manually coding the
headelement insrc/app/layout.tsxvalid / 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
headin 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