Skip to content

Commit

Permalink
Merge pull request #4346 from preactjs/types/fix-hydrate-render-creat…
Browse files Browse the repository at this point in the history
…ePortal

refactor: Support ComponentChild(ren) in compat render/hydrate/createPortal
  • Loading branch information
rschristian authored Apr 23, 2024
2 parents c1addc2 + 1fc799d commit aa95aa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions compat/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as preact from '../src';

export function createRoot(container: preact.ContainerNode): {
render(children: preact.VNode<any>): void;
render(children: preact.ComponentChild): void;
unmount(): void;
};

export function hydrateRoot(
container: preact.ContainerNode,
children: preact.VNode<any>
children: preact.ComponentChild
): typeof createRoot;
6 changes: 3 additions & 3 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ declare namespace React {
export import ChangeEventHandler = JSXInternal.GenericEventHandler;

export function createPortal(
vnode: preact.VNode,
vnode: preact.ComponentChildren,
container: preact.ContainerNode
): preact.VNode<any>;

export function render(
vnode: preact.VNode<any>,
vnode: preact.ComponentChild,
parent: preact.ContainerNode,
callback?: () => void
): Component | null;

export function hydrate(
vnode: preact.VNode<any>,
vnode: preact.ComponentChild,
parent: preact.ContainerNode,
callback?: () => void
): Component | null;
Expand Down

0 comments on commit aa95aa9

Please sign in to comment.