Open cabennetts opened 1 year ago
Essentially, everywhere there is an instance of name = 'someContent' ref={register}
, we should instead have name = 'someContent' {...register('someContent', { required: true })}
Two instances on this page, to my eye.
In /admin/[slug].js
Error 1:
const { register, errors, handleSubmit, formState, reset, watch } = useForm({ defaultValues, mode: 'onChange' });
should be changed toconst { register, handleSubmit, formState, reset, watch, formState: { errors } } = useForm({ defaultValues, mode: 'onChange' });
Error 2:
should be changed to
Error 3:
<input className={styles.checkbox} name="published" type="checkbox" ref={register} />
should be changed to