MCPcopy Index your code
hub / github.com/microsoft/SandDance / checkSelectPropTypes

Function checkSelectPropTypes

docs/external/js/react-dom.development.js:2288–2308  ·  view source on GitHub ↗

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

(props)

Source from the content-addressed store, hash-verified

2286 */
2287
2288 function checkSelectPropTypes(props) {
2289 {
2290 ReactControlledValuePropTypes.checkPropTypes('select', props);
2291
2292 for (var i = 0; i < valuePropNames.length; i++) {
2293 var propName = valuePropNames[i];
2294
2295 if (props[propName] == null) {
2296 continue;
2297 }
2298
2299 var isArray = Array.isArray(props[propName]);
2300
2301 if (props.multiple && !isArray) {
2302 error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
2303 } else if (!props.multiple && isArray) {
2304 error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
2305 }
2306 }
2307 }
2308 }
2309
2310 function updateOptions(node, multiple, propValue, setDefaultSelected) {
2311 var options = node.options;

Callers 1

initWrapperState$1Function · 0.85

Calls 2

errorFunction · 0.70

Tested by

no test coverage detected