* Validation function for `value` and `defaultValue`.
(props)
| 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; |
no test coverage detected