MCPcopy Index your code
hub / github.com/plotly/dash / checkSelectPropTypes

Function checkSelectPropTypes

dash/deps/react-dom@18.2.0.js:2072–2092  ·  view source on GitHub ↗

* Validation function for `value` and `defaultValue`.

(props)

Source from the content-addressed store, hash-verified

2070 */
2071
2072 function checkSelectPropTypes(props) {
2073 {
2074 checkControlledValueProps('select', props);
2075
2076 for (var i = 0; i < valuePropNames.length; i++) {
2077 var propName = valuePropNames[i];
2078
2079 if (props[propName] == null) {
2080 continue;
2081 }
2082
2083 var propNameIsArray = isArray(props[propName]);
2084
2085 if (props.multiple && !propNameIsArray) {
2086 error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
2087 } else if (!props.multiple && propNameIsArray) {
2088 error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
2089 }
2090 }
2091 }
2092 }
2093
2094 function updateOptions(node, multiple, propValue, setDefaultSelected) {
2095 var options = node.options;

Callers 1

initWrapperState$1Function · 0.70

Calls 4

isArrayFunction · 0.70
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…