I noticed that when typing the first character in my TextField, or when removing it (the first character only), my whole page is re-rendered.
If i remove the {...register("name")}
attribute, i don’t have this behavior, so it is directly related to react-hook-form
but i don’t have any clue why it is acting like this.
Re-render after typing or removing the first character of the input:
<TextField
type="text"
error={!!errors.name}
helperText={errors.name?.message?.toString()}
defaultValue=""
{...register("name")}
id="outlined-basic"
label="Nale"
/>
No issue:
<TextField
type="text"
error={!!errors.name}
helperText={errors.name?.message?.toString()}
defaultValue=""
id="outlined-basic"
label="Nale"
/>