Typescript typing of both <Head /> components, custom component children #64653
cyrilchapon
started this conversation in
Ideas
Replies: 8 comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
-
Can I work on this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Can I work on this issue you can Assign me this task |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bug report
Describe the bug
After reading #17721, #6919, and #13230 and the docs here, I just realized after several hours that my wrapping of
<link>
s in components inside the<Head>
(BOTH the document one and the app one) was not working. This is pretty subtle so I'll try to explain the double-bug stuff.This is a double bug that has the same root :
import { Head } from 'next/document'
) doesn't show the nice warningimport Head from 'next/head'
) accepts a custom component instead of links and stuff. This leads to a runtime bug that could be avoided (I think with narrowing thechildren
type)To Reproduce
Expected behavior
I'd expect to have followed that path at least :
Even better :
Screenshots
System information
Additional context
tsconfig.json
Beta Was this translation helpful? Give feedback.
All reactions