docs(runtime): clarify WithChildren adds a children prop to $props
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* Adds an optional `children` to a component's JSX `$props` so that TSX written
|
* Adds an optional `children` prop to a component's JSX `$props` so that TSX
|
||||||
* under the automatic runtime (`jsx: "react-jsx"` + `jsxImportSource: "vue"`)
|
* written under the automatic runtime (`jsx: "react-jsx"` + `jsxImportSource:
|
||||||
* accepts child content. Vue's JSX namespace defines no `ElementChildrenAttribute`,
|
* "vue"`) accepts child content. Vue's JSX namespace defines no
|
||||||
* so the automatic runtime passes children as a `children` prop — which must be
|
* `ElementChildrenAttribute`, so the automatic runtime passes children as a
|
||||||
* present on `$props` to type-check. Vue routes that prop to the default slot at
|
* `children` prop — which must be present on `$props` to type-check. Vue routes
|
||||||
* runtime, so this is a type-only shim with no runtime effect.
|
* that prop to the default slot at runtime, so this is a type-only shim with no
|
||||||
|
* runtime effect.
|
||||||
*/
|
*/
|
||||||
export type WithChildren<C, T = unknown> = C & {
|
export type WithChildren<C, T = unknown> = C & {
|
||||||
new (): { $props: { children?: T } };
|
new (): { $props: { children?: T } };
|
||||||
|
|||||||
Reference in New Issue
Block a user