You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using <Head /> from next/head in the /pages directory and using data from getInitialProps, the HTML head tag is not rendering with code in the /pages folder.
The only time this seems to work is when <Head /> is used in the _app.jsx file. The problem with this approach though is that all pages will undergo server-side rendering. I would only want the afore mentioned page to have custom values in the HTML head tag.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using
<Head />
fromnext/head
in the/pages
directory and using data fromgetInitialProps
, the HTMLhead
tag is not rendering with code in the/pages
folder.The only time this seems to work is when
<Head />
is used in the_app.jsx
file. The problem with this approach though is that all pages will undergo server-side rendering. I would only want the afore mentioned page to have custom values in the HTMLhead
tag.Beta Was this translation helpful? Give feedback.
All reactions