How do I tell if a Form is Valid / Invalid in React?
Angular has this syntax on Formbuilders.
this.form.valid;
I am using this coding syntax. Curious if anything exists in the React library? Currently using Material UI Library.
Right now, I am doing if else statements and error checking all 10 fields. Looking for shorthand method.
https://onestepcode.com/creating-a-material-ui-form/
<form onSubmit={handleSubmit}>
<Grid container alignItems="center" justify="center" direction="column">
<Grid item>
<TextField
id="name-input"
name="name"
label="Name"
type="text"
value={formValues.name}
onChange={handleInputChange}
/>
</Grid>
<Grid item>
<TextField
id="age-input"
name="age"
label="Age"
type="number"
value={formValues.age}
onChange={handleInputChange}
/>