Fixed infinite saving when input was connected

This commit is contained in:
Lucas Oliveira 2023-12-31 12:07:07 -03:00
commit 1ec50a2f27

View file

@ -24,10 +24,10 @@ export default function InputComponent({
const refInput = useRef<HTMLInputElement>(null);
// Clear component state
useEffect(() => {
if (disabled) {
if (disabled && value !== "") {
onChange("");
}
}, [disabled, onChange]);
}, [disabled]);
return (
<div className="relative w-full">