-
I was trying to fix a multiple viewport meta tags issue caused by adding a I can't think of any next.js/packages/next/pages/_document.tsx Lines 302 to 306 in 2828b01 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Just for those that missed the link: issue #19720 contains the proposal for a more permissive use of document/head! |
Beta Was this translation helpful? Give feedback.
next/head
is dynamic, you can use it multiple times, update it, remove it, and yourhead
tag will reflect those changes._document.js
is only rendered once, in the server, and for your entire page, this is the one that generates the initialhtml
tag that will be used for your page and it's not a place to save any tags that rely on dynamic data, or that only apply for some pages. A good use case for this one is for example to add a custom favicon link, or google analytics, something that you know only needs to be added once and has to be always there._app.js
is similar in the way that it's also applied globally, but it does get rendered again every time you switch the current page, so it'…