MCPcopy
hub / github.com/preactjs/preact / createRoot

Function createRoot

compat/client.mjs:3–14  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

1import { render, hydrate, unmountComponentAtNode } from 'preact/compat';
2
3export function createRoot(container) {
4 return {
5 // eslint-disable-next-line
6 render: function (children) {
7 render(children, container);
8 },
9 // eslint-disable-next-line
10 unmount: function () {
11 unmountComponentAtNode(container);
12 }
13 };
14}
15
16export function hydrateRoot(container, children) {
17 hydrate(children, container);

Callers 1

hydrateRootFunction · 0.70

Calls 2

renderFunction · 0.90
unmountComponentAtNodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…