uncontrolled components reactjs interview questions

Solutions on MaxInterview for uncontrolled components reactjs interview questions by the best coders in the world

showing results for - "uncontrolled components reactjs interview questions"
Julián
31 Nov 2020
1function FormValidation(props) {
2 let inputValue = React.createRef();
3
4 let handleSubmit = e => {
5   alert(`Input value: ${inputValue.current.value}`);
6   e.preventDefault();
7 };
8
9 return (
10   <div>
11     <form onSubmit={handleSubmit}>
12       <input type="text" ref={inputValue} />
13       <button type="submit">Submit</button>
14     </form>
15   </div>
16 );
17}
18