HTML forms → keep internal state inside DOM w/ some default behavior onSubmit (action)

Screenshot 2026-01-11 at 2.23.03 PM.png

controlled components → offer API

Screenshot 2026-01-11 at 2.26.56 PM.png

Screenshot 2026-01-11 at 2.27.13 PM.png

uncontrolled components

const Form = () => { 
 const inputRef = useRef(null); 

 const handleSubmit = () => { 
   const inputValue = inputRef.current.value; 
   // Do something with the value 
 } 
 return ( 
   <form onSubmit={handleSubmit}> 
     <input ref={inputRef} type="text" /> 
   </form> 
 ); 
};

controlled components