import React, { FC, useEffect, useRef } from 'react'; import cx from 'classnames'; export interface Props extends React.HTMLAttributes { label?: string; checked?: boolean; disabled?: boolean; indeterminate?: boolean; name?: string; onChange?: (event: React.ChangeEvent) => void; } const Checkbox: FC = ({ label, className, disabled = false, indeterminate = false, checked, children, onChange, name, ...props }) => { const inputRef = useRef(null); useEffect(() => { if (!inputRef.current) return; inputRef.current.indeterminate = indeterminate; }, [inputRef, indeterminate]); return ( ); }; export default Checkbox;