Questions
Answer the following questions to check what you have learned about forms in React:
- How many times will the following form render after the initial render when
Bob
is entered into the name field?function ControlledForm () {
const [name, setName] = useState('');
return (
<form
onSubmit={(e) => {
e.preventDefault();
console.log(name);
}}
>
<input
placeholder="Enter your name"
value={name}
onChange={(e) => setName(e.target.value)}
/>
</form>
);
}
- How many...