Sha256: ae8a4357db81f77d178b0d5cfb0a528df047a088adb89f258932d2100642d067

Contents?: true

Size: 732 Bytes

Versions: 92

Compression:

Stored size: 732 Bytes

Contents

import { diff } from './vdom/diff';

/**
 * Render JSX into a `parent` Element.
 * @param {import('./vnode').VNode} vnode A (JSX) VNode to render
 * @param {import('./dom').PreactElement} parent DOM element to render into
 * @param {import('./dom').PreactElement} [merge] Attempt to re-use an existing DOM tree rooted at
 *  `merge`
 * @public
 *
 * @example
 * // render a div into <body>:
 * render(<div id="hello">hello!</div>, document.body);
 *
 * @example
 * // render a "Thing" component into #foo:
 * const Thing = ({ name }) => <span>{ name }</span>;
 * render(<Thing name="one" />, document.querySelector('#foo'));
 */
export function render(vnode, parent, merge) {
	return diff(merge, vnode, {}, false, parent, false);
}

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
govuk_publishing_components-17.21.0 node_modules/preact/src/render.js
govuk_publishing_components-17.20.0 node_modules/preact/src/render.js
govuk_publishing_components-17.19.1 node_modules/preact/src/render.js
govuk_publishing_components-17.19.0 node_modules/preact/src/render.js
govuk_publishing_components-17.18.0 node_modules/preact/src/render.js
govuk_publishing_components-17.17.0 node_modules/preact/src/render.js
govuk_publishing_components-17.16.0 node_modules/preact/src/render.js
govuk_publishing_components-17.15.0 node_modules/preact/src/render.js
govuk_publishing_components-17.14.0 node_modules/preact/src/render.js
govuk_publishing_components-17.13.0 node_modules/preact/src/render.js
govuk_publishing_components-17.12.2 node_modules/preact/src/render.js
govuk_publishing_components-17.12.1 node_modules/preact/src/render.js
govuk_publishing_components-17.12.0 node_modules/preact/src/render.js
govuk_publishing_components-17.11.0 node_modules/preact/src/render.js
govuk_publishing_components-17.10.0 node_modules/preact/src/render.js
govuk_publishing_components-17.9.0 node_modules/preact/src/render.js
govuk_publishing_components-17.8.0 node_modules/preact/src/render.js
govuk_publishing_components-17.7.0 node_modules/preact/src/render.js
govuk_publishing_components-17.6.1 node_modules/preact/src/render.js
govuk_publishing_components-17.6.0 node_modules/preact/src/render.js