Skip to content

Commit

Permalink
fix(radio-group): add value to interface and prop types
Browse files Browse the repository at this point in the history
Radio Group was inheriting the interface from inline control group
which doesn't actually use value. So explicitly declare value just for
Radio Group
  • Loading branch information
SiTaggart committed Mar 31, 2021
1 parent 09b565a commit 658c408
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/nervous-moles-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@twilio-paste/radio-group': patch
'@twilio-paste/core': patch
---

[RadioGroup] Added optional `value` string prop which this component needs and is no longer on the extended `InlineControlGroup` interface.
2 changes: 2 additions & 0 deletions packages/paste-core/components/radio-group/src/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {RadioContext} from './RadioContext';
export interface RadioGroupProps extends InlineControlGroupProps {
name: string;
onChange: (value: string) => void;
value?: string;
}

const RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(
Expand Down Expand Up @@ -45,6 +46,7 @@ if (process.env.NODE_ENV === 'development') {
RadioGroup.propTypes = {
name: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
value: PropTypes.string,
};
}

Expand Down

0 comments on commit 658c408

Please sign in to comment.