Skip to content

Commit

Permalink
fix(FormGroup): dont pass switch prop to tag #2415
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegoatly-coeo committed Dec 10, 2021
1 parent 37a63c6 commit b63981e
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 b63981e

Please sign in to comment.