Skip to content

Commit

Permalink
feat(radio): complete radio button logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bramvanhoutte committed May 16, 2020
1 parent b796403 commit 13442b7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/Radio/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const RadioGroup: React.FC<Props> = ({
}: Props) => {
const [selectedValue, setSelectedValue] = useState(defaultValue);

const radioGroupClassNames = classNames(className);

const onRadioItemChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setSelectedValue(e.target.value);
if (onChange) {
Expand All @@ -40,7 +38,7 @@ const RadioGroup: React.FC<Props> = ({

return (
<radioContext.Provider value={{ selectedValue, onChange: onRadioItemChange, name, groupRef }}>
<div className={radioGroupClassNames}>{children}</div>
<div className={className}>{children}</div>
</radioContext.Provider>
);
};
Expand Down

0 comments on commit 13442b7

Please sign in to comment.