MCPcopy Create free account
hub / github.com/ampproject/amphtml / newDiff

Function newDiff

src/preact/compat/internal.js:29–35  ·  view source on GitHub ↗

* Checks if our VNode type has a `forwardRef_` sigil, in which case it was created by our forwardRef implementation. * If so, we move the VNode's ref to it's props, which will be passed to the Component as its props. * * See VNode type at https://github.com/preactjs/preact/blob/55ee4bc069f84cf5e3

(vnode)

Source from the content-addressed store, hash-verified

27 * @param {*} vnode
28 */
29function newDiff(vnode) {
30 if (vnode['type']?.forwardRef_ && vnode['ref']) {
31 vnode['props']['ref'] = vnode['ref'];
32 vnode['ref'] = null;
33 }
34 oldDiff?.(vnode);
35}
36
37/**
38 * Reimplements forwardRef without dragging in everything from preact/compat.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected