Answers for "uncontrolled components reactjs interview questions"

0

uncontrolled components reactjs interview questions

function FormValidation(props) {
 let inputValue = React.createRef();

 let handleSubmit = e => {
   alert(`Input value: ${inputValue.current.value}`);
   e.preventDefault();
 };

 return (
   <div>
     <form onSubmit={handleSubmit}>
       <input type="text" ref={inputValue} />
       <button type="submit">Submit</button>
     </form>
   </div>
 );
}
Posted by: Guest on May-21-2021

Code answers related to "uncontrolled components reactjs interview questions"

Code answers related to "Javascript"

Browse Popular Code Answers by Language