Skip to content

Commit

Permalink
feat(radio-field): remove onChange default handler and make onChange …
Browse files Browse the repository at this point in the history
…optional on calls
  • Loading branch information
maximedasilva committed Oct 17, 2022
1 parent 8ce417d commit 4133014
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/lib/RadioField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const RadioField = forwardRef(({
parseValue = val => val?.value ?? val,
parseTitle = val => val?.title ?? val?.toString?.(),
parseDescription = val => val?.description || '',
onChange = () => {},
onChange,
onValidate = (val, { required }) =>
(val !== undefined && val !== null) || !required,
...rest
Expand Down Expand Up @@ -60,7 +60,7 @@ const RadioField = forwardRef(({
dirty: true,
});

onChange({
onChange?.({
value: parseValue(option),
valid,
});
Expand Down

0 comments on commit 4133014

Please sign in to comment.