-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any elements must be direct children of next/head #11557
Merged
timneutkens
merged 1 commit into
vercel:canary
from
yossisp:update-next-head-documentation
Apr 6, 2020
Merged
Any elements must be direct children of next/head #11557
timneutkens
merged 1 commit into
vercel:canary
from
yossisp:update-next-head-documentation
Apr 6, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…/head, not just meta or title. It is any elements and not only meta or title because the children of next/head are generated in here: https://github.com/zeit/next.js/blob/8c899ee5e4cadc0a1cb47918613c1f6028b26314/packages/next/next-server/lib/head.tsx#L139 where React.cloneElement is called without the third parameter which is needed to clone the children as well (https://reactjs.org/docs/react-api.html#cloneelement).
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless Mode (Decrease detected ✓)General
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles Overall decrease ✓
|
timneutkens
approved these changes
Apr 6, 2020
Thanks! |
This was referenced Apr 17, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think it would be nice to mention that absolutely any children elements of
next/head
must be direct descendants, not justmeta
ortitle
. This information may prevent the issue #8921.It is any elements and not only
meta
ortitle
because the children ofnext/head
are generated herewhere
React.cloneElement
is called without the third parameter which is needed to clone the children (https://reactjs.org/docs/react-api.html#cloneelement). The elements are generated this way client-side, so server-side the issue will not be experienced.