Skip to content

Commit b63981e

Browse files
fix(FormGroup): dont pass switch prop to tag reactstrap#2415
1 parent 37a63c6 commit b63981e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/FormGroup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ const FormGroup = (props) => {
3030
inline,
3131
floating,
3232
tag: Tag,
33+
switch: switchProp,
3334
...attributes
3435
} = props;
3536

36-
const formCheck = check || props.switch;
37+
const formCheck = check || switchProp;
3738

3839
const classes = mapToCssModules(classNames(
3940
className,
4041
row ? 'row' : false,
4142
formCheck ? 'form-check' : 'mb-3',
42-
props.switch ? 'form-switch' : false,
43+
switchProp ? 'form-switch' : false,
4344
formCheck && inline ? 'form-check-inline' : false,
4445
formCheck && disabled ? 'disabled' : false,
4546
floating && 'form-floating'

types/lib/FormGroup.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {
55
[key: string]: any;
66
row?: boolean;
77
check?: boolean;
8+
switch?: boolean;
89
inline?: boolean;
910
floating?: boolean;
1011
disabled?: boolean;

0 commit comments

Comments
 (0)