MCPcopy Create free account
hub / github.com/reactjs/react-rails / setTextContent

Function setTextContent

lib/assets/react-source/development/react.js:6258–6269  ·  view source on GitHub ↗
(node, text)

Source from the content-addressed store, hash-verified

6256 */
6257
6258 var setTextContent = function (node, text) {
6259 if (text) {
6260 var firstChild = node.firstChild;
6261
6262 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
6263 firstChild.nodeValue = text;
6264 return;
6265 }
6266 }
6267
6268 node.textContent = text;
6269 };
6270
6271 // Do not use the below two methods directly!
6272 // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.

Callers 3

setInitialDOMPropertiesFunction · 0.85
updateDOMPropertiesFunction · 0.85
resetTextContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected