const submitHandler = (e) => {
e.preventDefault();
if (input === "") {
setError(true);
}
}
useEffect(() => {
// No need for === true
if (error) {
console.log("error");
return;
}
console.log("success");
}, [error])