Set default for 'checked' property
This commit is contained in:
parent
5a988cb528
commit
efb3097c80
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ interface IToggle extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'id'
|
|||
}
|
||||
|
||||
/** A glorified checkbox. */
|
||||
const Toggle: React.FC<IToggle> = ({ id, size = 'md', name, checked, onChange, required, disabled }) => {
|
||||
const Toggle: React.FC<IToggle> = ({ id, size = 'md', name, checked = false, onChange, required, disabled }) => {
|
||||
const input = useRef<HTMLInputElement>(null);
|
||||
|
||||
const handleClick: React.MouseEventHandler<HTMLButtonElement> = () => {
|
||||
|
|
Loading…
Reference in a new issue