Skip to content

type of htm/preact and htm directly are different #244

@Haroenv

Description

@Haroenv

declare const html: (strings: TemplateStringsArray, ...values: any[]) => VNode;

this returns VNode, while if you do htm.bind(h) the inferred return type is VNode | VNode[]

htm/src/index.d.ts

Lines 2 to 4 in d62dcfd

bind<HResult>(
h: (type: any, props: Record<string, any>, ...children: any[]) => HResult
): (strings: TemplateStringsArray, ...values: any[]) => HResult | HResult[];

Which one of the two types is correct? Should this be changed in the htm/preact type?

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