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

Function cloneElement

compat/src/index.js:93–96  ·  view source on GitHub ↗

* Wrap `cloneElement` to abort if the passed element is not a valid element and apply * all vnode normalizations. * @param {import('./internal').VNode} element The vnode to clone * @param {object} props Props to add when cloning * @param {Array } rest Optio

(element)

Source from the content-addressed store, hash-verified

91 * @param {Array<import('./internal').ComponentChildren>} rest Optional component children
92 */
93function cloneElement(element) {
94 if (!isValidElement(element)) return element;
95 return preactCloneElement.apply(null, arguments);
96}
97
98/**
99 * Remove a component tree from the DOM, including state and event handlers.

Callers 1

Calls 1

isValidElementFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…