I am trying to throw required errors from my input which I have wrapped in a Controller component from react-hook-form version 7.
My Input is a Material-UI TextField as such;
<Controller
name="firstName"
control={control}
defaultValue=""
rules={{ required: true}}
render={({field}) =>
<TextField
id="firstName"
name="firstName"
autoComplete="fname"
variant="outlined"
fullWidth
label="First Name"
autoFocus={true}
{...field} />
}
/>
I would like to expose an error when rules fails.