Skip to content

[ts] components can return ComponentChildren#3482

Closed
developit wants to merge 2 commits intomainfrom
fix-ts-render-return-values
Closed

[ts] components can return ComponentChildren#3482
developit wants to merge 2 commits intomainfrom
fix-ts-render-return-values

Conversation

@developit
Copy link
Copy Markdown
Member

Previously FunctionComponent was only typed as returning VNode | null, but Preact supports returning Arrays as well as any VDOM text primitive (boolean, etc). Class component render methods were typed as returning ComponentChild, which doesn't reflect the fact that this method can also return Arrays.

Previously `FunctionComponent` was only typed as returning `VNode | null`, but Preact supports returning Arrays as well as any VDOM text primitive (boolean, etc). Class component render methods were typed as returning `ComponentChild`, which doesn't reflect the fact that this method can also return Arrays.
@marvinhagemeister
Copy link
Copy Markdown
Member

Looks like this breaks JSX types.

@rschristian rschristian linked an issue Apr 23, 2024 that may be closed by this pull request
1 task
@JoviDeCroock JoviDeCroock deleted the fix-ts-render-return-values branch November 13, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types: Unable to return ComponentChild from component

4 participants