Skip to content

Commit e981f55

Browse files
authored
Added warning on improper value prop usage (#37)
1 parent b09eb4a commit e981f55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Field.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export default class Field extends React.PureComponent<Props, State> {
121121
value = ''
122122
}
123123
const input = { name, value, ...this.handlers }
124+
warning(
125+
!_value || (rest.type === 'radio' && component === 'input'),
126+
'The value prop on Field is ONLY for use with component="input" and type="radio".'
127+
)
124128
if (rest.type === 'checkbox') {
125129
input.checked = !!value
126130
} else if (rest.type === 'radio') {

0 commit comments

Comments
 (0)