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

Function updateDOMProperties

lib/assets/react-source/development/react.js:9531–9547  ·  view source on GitHub ↗
(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag)

Source from the content-addressed store, hash-verified

9529 }
9530
9531 function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
9532 // TODO: Handle wasCustomComponentTag
9533 for (var i = 0; i < updatePayload.length; i += 2) {
9534 var propKey = updatePayload[i];
9535 var propValue = updatePayload[i + 1];
9536
9537 if (propKey === STYLE) {
9538 setValueForStyles(domElement, propValue);
9539 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
9540 setInnerHTML(domElement, propValue);
9541 } else if (propKey === CHILDREN) {
9542 setTextContent(domElement, propValue);
9543 } else {
9544 setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
9545 }
9546 }
9547 }
9548
9549 function createElement(type, props, rootContainerElement, parentNamespace) {
9550 var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML

Callers 1

updatePropertiesFunction · 0.85

Calls 3

setValueForStylesFunction · 0.85
setTextContentFunction · 0.85
setValueForPropertyFunction · 0.85

Tested by

no test coverage detected