Skip to content

Commit 1a7bb34

Browse files
committed
fix(radio-group): add value to interface and prop types
Radio Group was inheriting the interface from inline control group which doesn't actually use value. So explicitly declare value just for Radio Group
1 parent 5e08f10 commit 1a7bb34

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/nervous-moles-sleep.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@twilio-paste/radio-group': patch
3+
'@twilio-paste/core': patch
4+
---
5+
6+
[RadioGroup] Added optional `value` string prop which this component needs and is no longer on the extended `InlineControlGroup` interface.

packages/paste-core/components/radio-group/src/RadioGroup.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {RadioContext} from './RadioContext';
77
export interface RadioGroupProps extends InlineControlGroupProps {
88
name: string;
99
onChange: (value: string) => void;
10+
value?: string;
1011
}
1112

1213
const RadioGroup = React.forwardRef<HTMLFieldSetElement, RadioGroupProps>(
@@ -45,6 +46,7 @@ if (process.env.NODE_ENV === 'development') {
4546
RadioGroup.propTypes = {
4647
name: PropTypes.string.isRequired,
4748
onChange: PropTypes.func.isRequired,
49+
value: PropTypes.string,
4850
};
4951
}
5052

0 commit comments

Comments
 (0)