Skip to content

JSX children should be considered JsxNode | NestedArray<JsxNode> instead of always NestedArray<JsxNode>. #2

Description

@thejimmylin

Because a component has this type:

type Component = (props: JsxProps) => Renderable;
type Renderable = JsxNode | NestedArray<JsxNode>;

If we set children as children[0] when children.length is 0, the type of JSX children would be the same as the return type of a component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions