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 26, 2021
1 parent 0cb19a1 commit 5d2d3f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-moles-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@twilio-paste/radio-group': patch
---

Value is added as a prop used specifically by RadioGroup as it was inheriting its prop interface from InlineContorlGroup which doens't use value at all.
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 5d2d3f0

Please sign in to comment.