Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function createRootFragment
import { createRootFragment } from "https://deno.land/x/frugal@0.9.1/src/runtime/preact/hydrate/createRootFragment.ts";

A Preact 11+ implementation of the replaceNode parameter from Preact 10.

This creates a "Persistent Fragment" (a fake DOM element) containing one or more DOM nodes, which can then be passed as the parent argument to Preact's render() method.

Parameters

parent: Node & { __k?: unknown; }
replaceNode: Node | Node[]