Skip to content
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

[ts] components can return ComponentChildren #3482

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

developit
Copy link
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
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
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