MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / setTextContent

Function setTextContent

code/new-context-api/public/app.js:14212–14222  ·  view source on GitHub ↗
(node, text)

Source from the content-addressed store, hash-verified

14210 * @internal
14211 */
14212var setTextContent = function (node, text) {
14213 if (text) {
14214 var firstChild = node.firstChild;
14215
14216 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
14217 firstChild.nodeValue = text;
14218 return;
14219 }
14220 }
14221 node.textContent = text;
14222};
14223
14224/**
14225 * CSS properties which accept numbers but are not in units of "px".

Callers 3

setInitialDOMPropertiesFunction · 0.70
updateDOMPropertiesFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected