preact icon indicating copy to clipboard operation
preact copied to clipboard

[ts] components can return ComponentChildren

Open developit opened this issue 2 years ago • 1 comments

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.

developit avatar Mar 17 '22 20:03 developit

Looks like this breaks JSX types.

marvinhagemeister avatar Mar 17 '22 21:03 marvinhagemeister