Controlled vs uncontrolled forms in React
The form
Let's say you have a simple form in React with an input and a button.
const submitForm = (e) => {
e.PreventDefault();
//do something with input
}
return (
<form onSubmit={submitForm}>
<label htmlFor="myInput">
<input id="myInp...
blog.nicm42.me.uk3 min read