MCPcopy Create free account
hub / github.com/caseywebdev/react-list / diffHydratedProperties

Function diffHydratedProperties

docs/index.js:37012–37662  ·  view source on GitHub ↗
(domElement, tag, props, hostContext)

Source from the content-addressed store, hash-verified

37010 warnForPropDifference(propKey, domElement, value, serverDifferences);
37011 }
37012 function diffHydratedProperties(domElement, tag, props, hostContext) {
37013 for (
37014 var serverDifferences = {},
37015 extraAttributes = new Set(),
37016 attributes = domElement.attributes,
37017 i = 0;
37018 i < attributes.length;
37019 i++
37020 )
37021 switch (attributes[i].name.toLowerCase()) {
37022 case "value":
37023 break;
37024 case "checked":
37025 break;
37026 case "selected":
37027 break;
37028 default:
37029 extraAttributes.add(attributes[i].name);
37030 }
37031 if (isCustomElement(tag))
37032 for (var propKey in props) {
37033 if (props.hasOwnProperty(propKey)) {
37034 var value = props[propKey];
37035 if (null != value)
37036 if (registrationNameDependencies.hasOwnProperty(propKey))
37037 "function" !== typeof value &&
37038 warnForInvalidEventListener(propKey, value);
37039 else if (!0 !== props.suppressHydrationWarning)
37040 switch (propKey) {
37041 case "children":
37042 ("string" !== typeof value && "number" !== typeof value) ||
37043 warnForPropDifference(
37044 "children",
37045 domElement.textContent,
37046 value,
37047 serverDifferences
37048 );
37049 continue;
37050 case "suppressContentEditableWarning":
37051 case "suppressHydrationWarning":
37052 case "defaultValue":
37053 case "defaultChecked":
37054 case "innerHTML":
37055 case "ref":
37056 continue;
37057 case "dangerouslySetInnerHTML":
37058 attributes = domElement.innerHTML;
37059 value = value ? value.__html : void 0;
37060 null != value &&
37061 ((value = normalizeHTML(domElement, value)),
37062 warnForPropDifference(
37063 propKey,
37064 attributes,
37065 value,
37066 serverDifferences
37067 ));
37068 continue;
37069 case "style":

Callers 1

beginWorkFunction · 0.85

Calls 15

isCustomElementFunction · 0.85
warnForPropDifferenceFunction · 0.85
normalizeHTMLFunction · 0.85
diffHydratedStylesFunction · 0.85
hydrateAttributeFunction · 0.85
hydrateBooleanAttributeFunction · 0.85
hydrateNumericAttributeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…