Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

input creates console log delay

const submitHandler = (e) => {
   e.preventDefault();
   if (input === "") {
     setError(true);
   }
}

useEffect(() => {
   // No need for === true
   if (error) {
     console.log("error");
     return;
   }
   console.log("success");
}, [error])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #creates #console #log #delay
ADD COMMENT
Topic
Name
3+6 =