diff --git a/src/FormGroup.js b/src/FormGroup.js index 6456a7226..dcb5cdfb8 100644 --- a/src/FormGroup.js +++ b/src/FormGroup.js @@ -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' diff --git a/types/lib/FormGroup.d.ts b/types/lib/FormGroup.d.ts index 70084ebe9..09d851238 100644 --- a/types/lib/FormGroup.d.ts +++ b/types/lib/FormGroup.d.ts @@ -5,6 +5,7 @@ export interface FormGroupProps extends React.HTMLAttributes { [key: string]: any; row?: boolean; check?: boolean; + switch?: boolean; inline?: boolean; floating?: boolean; disabled?: boolean;