diff --git a/lib/attributes-to-props.js b/lib/attributes-to-props.js index 706a7471..da20b79d 100644 --- a/lib/attributes-to-props.js +++ b/lib/attributes-to-props.js @@ -10,9 +10,10 @@ var utilities = require('./utilities'); module.exports = function attributesToProps(attributes) { attributes = attributes || {}; - var valueOnlyInputs = { + var valueOnlyTypes = { reset: true, - submit: true + submit: true, + option: true }; var attributeName; @@ -21,7 +22,7 @@ module.exports = function attributesToProps(attributes) { var propName; var propertyInfo; var props = {}; - var inputIsValueOnly = attributes.type && valueOnlyInputs[attributes.type]; + var typeIsValueOnly = attributes.type && valueOnlyTypes[attributes.type]; for (attributeName in attributes) { attributeValue = attributes[attributeName]; @@ -43,7 +44,7 @@ module.exports = function attributesToProps(attributes) { // https://reactjs.org/docs/uncontrolled-components.html if ( (propName === 'checked' || propName === 'value') && - !inputIsValueOnly + !typeIsValueOnly ) { propName = getPropName('default' + attributeNameLowerCased); }