I'm using react-hook-form to control and validate a form with one required input.
const {control, handleSubmit, formState, reset} = useForm({
mode: 'onChange',
});
const {isDirty, isValid, errors} = formState;
To disable the submit button:
disabled={!isDirty || !isValid}
The issue is that initially, the submit button is not disabled even if the input is empty.
