π§ feat: <FormStateSubscribe /> component (#13142)
import { useForm, FormStateSubscribe } from 'react-hook-form';
const App = () => {
const { register, control } = useForm();
return (
<div>
<form>
<input {...register('foo')} />
<input {...register('bar')} />
</form>
{/* re-render only when formState of `foo` changes */}
<FormStateSubscribe
control={control}
name={"foo"}
render={({errors}) => <span>{errors.foo?.message}</span>}
/>
</div>
);
};π fix: clear validation errors synchronously in reset() to fix Next.js 16 Server Actions issue (#13139)
Revert "β¨ fix(types): allow undefined value with async defaultValues in Contrβ¦" (#13171)
thanks to @xiangnuans, @abnud11, @ntatoud & @ap0nia