fix indeterminate state not reseting (#1112)

This commit is contained in:
Thibaut Sardan
2022-07-14 16:54:12 +03:00
committed by GitHub
parent 63d643c3aa
commit 5c163752ea
@@ -21,8 +21,8 @@ function Checkbox ({ checked, className, indeterminate, label, onChange, onClick
const checkboxRef = React.useRef<HTMLInputElement | null>(null);
useEffect(() => {
if (indeterminate && checkboxRef.current) {
checkboxRef.current.indeterminate = true;
if (checkboxRef.current) {
checkboxRef.current.indeterminate = !!indeterminate;
}
}, [indeterminate]);