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

Function setTextContent

code/controlled-uncontrolled/public/app.js:14175–14185  ·  view source on GitHub ↗
(node, text)

Source from the content-addressed store, hash-verified

14173 * @internal
14174 */
14175var setTextContent = function (node, text) {
14176 if (text) {
14177 var firstChild = node.firstChild;
14178
14179 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
14180 firstChild.nodeValue = text;
14181 return;
14182 }
14183 }
14184 node.textContent = text;
14185};
14186
14187/**
14188 * 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