MCPcopy Create free account
hub / github.com/plotly/dash / getValueForAttribute

Function getValueForAttribute

dash/deps/react-dom@18.3.1.js:731–753  ·  view source on GitHub ↗

* Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values.

(node, name, expected, isCustomComponentTag)

Source from the content-addressed store, hash-verified

729 */
730
731 function getValueForAttribute(node, name, expected, isCustomComponentTag) {
732 {
733 if (!isAttributeNameSafe(name)) {
734 return;
735 }
736
737 if (!node.hasAttribute(name)) {
738 return expected === undefined ? undefined : null;
739 }
740
741 var value = node.getAttribute(name);
742
743 {
744 checkAttributeStringCoercion(expected, name);
745 }
746
747 if (value === '' + expected) {
748 return expected;
749 }
750
751 return value;
752 }
753 }
754 /**
755 * Sets the value for a property on a node.
756 *

Callers 1

diffHydratedPropertiesFunction · 0.70

Calls 2

isAttributeNameSafeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…