(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag)
| 5904 | } |
| 5905 | |
| 5906 | function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { |
| 5907 | for (var propKey in nextProps) { |
| 5908 | if (!nextProps.hasOwnProperty(propKey)) { |
| 5909 | continue; |
| 5910 | } |
| 5911 | |
| 5912 | var nextProp = nextProps[propKey]; |
| 5913 | |
| 5914 | if (propKey === STYLE) { |
| 5915 | { |
| 5916 | if (nextProp) { |
| 5917 | // Freeze the next style object so that we can assume it won't be |
| 5918 | // mutated. We have already warned for this in the past. |
| 5919 | Object.freeze(nextProp); |
| 5920 | } |
| 5921 | } // Relies on `updateStylesByID` not mutating `styleUpdates`. |
| 5922 | |
| 5923 | |
| 5924 | setValueForStyles(domElement, nextProp); |
| 5925 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { |
| 5926 | var nextHtml = nextProp ? nextProp[HTML$1] : undefined; |
| 5927 | |
| 5928 | if (nextHtml != null) { |
| 5929 | setInnerHTML(domElement, nextHtml); |
| 5930 | } |
| 5931 | } else if (propKey === CHILDREN) { |
| 5932 | if (typeof nextProp === 'string') { |
| 5933 | // Avoid setting initial textContent when the text is empty. In IE11 setting |
| 5934 | // textContent on a <textarea> will cause the placeholder to not |
| 5935 | // show within the <textarea> until it has been focused and blurred again. |
| 5936 | // https://github.com/facebook/react/issues/6731#issuecomment-254874553 |
| 5937 | var canSetTextContent = tag !== 'textarea' || nextProp !== ''; |
| 5938 | |
| 5939 | if (canSetTextContent) { |
| 5940 | setTextContent(domElement, nextProp); |
| 5941 | } |
| 5942 | } else if (typeof nextProp === 'number') { |
| 5943 | setTextContent(domElement, '' + nextProp); |
| 5944 | } |
| 5945 | } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) { |
| 5946 | if (nextProp != null) { |
| 5947 | if ( typeof nextProp !== 'function') { |
| 5948 | warnForInvalidEventListener(propKey, nextProp); |
| 5949 | } |
| 5950 | |
| 5951 | ensureListeningTo(rootContainerElement, propKey); |
| 5952 | } |
| 5953 | } else if (nextProp != null) { |
| 5954 | setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag); |
| 5955 | } |
| 5956 | } |
| 5957 | } |
| 5958 | |
| 5959 | function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) { |
| 5960 | // TODO: Handle wasCustomComponentTag |
no test coverage detected