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