MCPcopy Create free account
hub / github.com/Lucifier129/react-lite / setID

Function setID

examples/simple/react.js:10736–10743  ·  view source on GitHub ↗

* Sets the React-specific ID of the given node. * * @param {DOMElement} node The DOM node whose ID will be set. * @param {string} id The value of the ID attribute.

(node, id)

Source from the content-addressed store, hash-verified

10734 * @param {string} id The value of the ID attribute.
10735 */
10736function setID(node, id) {
10737 var oldID = internalGetID(node);
10738 if (oldID !== id) {
10739 delete nodeCache[oldID];
10740 }
10741 node.setAttribute(ATTR_NAME, id);
10742 nodeCache[id] = node;
10743}
10744
10745/**
10746 * Finds the node with the supplied React-generated DOM ID.

Callers

nothing calls this directly

Calls 1

internalGetIDFunction · 0.85

Tested by

no test coverage detected