Skip to content

Commit

Permalink
Merge pull request #2416 from mikegoatly/2415-FormGroup-switch-prop
Browse files Browse the repository at this point in the history
fix(FormGroup): dont pass switch prop to tag #2415
  • Loading branch information
davidacevedo committed Apr 13, 2022
2 parents 2e1be49 + 4e1e533 commit 714d557
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/FormGroup.js
Expand Up @@ -30,16 +30,17 @@ const FormGroup = (props) => {
inline,
floating,
tag: Tag,
switch: switchProp,
...attributes
} = props;

const formCheck = check || props.switch;
const formCheck = check || switchProp;

const classes = mapToCssModules(classNames(
className,
row ? 'row' : false,
formCheck ? 'form-check' : 'mb-3',
props.switch ? 'form-switch' : false,
switchProp ? 'form-switch' : false,
formCheck && inline ? 'form-check-inline' : false,
formCheck && disabled ? 'disabled' : false,
floating && 'form-floating'
Expand Down
1 change: 1 addition & 0 deletions types/lib/FormGroup.d.ts
Expand Up @@ -5,6 +5,7 @@ export interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {
[key: string]: any;
row?: boolean;
check?: boolean;
switch?: boolean;
inline?: boolean;
floating?: boolean;
disabled?: boolean;
Expand Down

0 comments on commit 714d557

Please sign in to comment.