Skip to content

Commit

Permalink
Merge pull request #448 from nextui-org/fix_431/checkbox-initial-checked
Browse files Browse the repository at this point in the history
Fix 431/checkbox initial checked
  • Loading branch information
jrgarciadev committed May 2, 2022
2 parents 9405a1c + 2aa2fe2 commit 19d2361
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react/src/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
StyledCheckboxText
} from './checkbox.styles';
import { mapPropsToReactAriaAttr } from './utils';
import { __DEV__ } from '../utils/assertion';
import clsx from '../utils/clsx';

interface Props
Expand Down Expand Up @@ -91,6 +92,8 @@ const Checkbox = React.forwardRef<HTMLLabelElement, CheckboxProps>(
labelColor,
animated,
autoFocus,
// @ts-ignore
initialChecked,
...props
} = checkboxProps;

Expand Down Expand Up @@ -205,7 +208,10 @@ const Checkbox = React.forwardRef<HTMLLabelElement, CheckboxProps>(

Checkbox.defaultProps = defaultProps;

Checkbox.displayName = 'NextUI.Checkbox';
if (__DEV__) {
Checkbox.displayName = 'NextUI.Checkbox';
}

Checkbox.toString = () => '.nextui-checkbox';

type CheckboxComponent<T, P = {}> = React.ForwardRefExoticComponent<
Expand Down

0 comments on commit 19d2361

Please sign in to comment.