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

Function render

compat/src/render.js:84–95  ·  view source on GitHub ↗
(vnode, parent, callback)

Source from the content-addressed store, hash-verified

82 * @returns {import('./internal').Component | null} The root component reference or null
83 */
84export function render(vnode, parent, callback) {
85 // React destroys any existing DOM nodes, see #1727
86 // ...but only on the first render, see #1828
87 if (parent._children == null) {
88 parent.textContent = '';
89 }
90
91 preactRender(vnode, parent);
92 if (typeof callback == 'function') callback();
93
94 return vnode ? vnode._component : null;
95}
96
97export function hydrate(vnode, parent, callback) {
98 preactHydrate(vnode, parent);

Callers 4

createRootFunction · 0.90
fnFunction · 0.90
createRootFunction · 0.50

Calls

no outgoing calls

Tested by 1

fnFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…