Skip to content

Commit

Permalink
Merge pull request #1214 from garybernhardt/reverse_h_type_definition…
Browse files Browse the repository at this point in the history
…_order

Fix confusing type errors by reversing order of overloaded h() definitions
  • Loading branch information
marvinhagemeister committed Nov 4, 2018
2 parents b243a5e + 0aece17 commit 3bbcdcc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/preact.d.ts
Expand Up @@ -101,16 +101,16 @@ declare namespace preact {
abstract render(props?: RenderableProps<P>, state?: Readonly<S>, context?: any): ComponentChild;
}

function h<P>(
node: ComponentFactory<P>,
params: Attributes & P | null,
...children: ComponentChildren[]
): VNode<any>;
function h(
node: string,
params: JSX.HTMLAttributes & JSX.SVGAttributes & Record<string, any> | null,
...children: ComponentChildren[]
): VNode<any>;
function h<P>(
node: ComponentFactory<P>,
params: Attributes & P | null,
...children: ComponentChildren[]
): VNode<any>;

function render(node: ComponentChild, parent: Element | Document | ShadowRoot | DocumentFragment, mergeWith?: Element): Element;
function rerender(): void;
Expand Down

0 comments on commit 3bbcdcc

Please sign in to comment.