🖱️ improve dx with reset API within onSubmit or combined with other (#7274)
const onSubmit = (data) => {};
React.useEffect(() => {
if (formState.isSubmitSuccessful) {
reset({ something: '' });
}
}, [formState, reset]);
handleSubmit(onSubmit);
to
const onSubmit = (data) => {
setSubmittedData(data);
reset(data); // no longer need to have useEffect
};
handleSubmit(onSubmit);
🐞 fix #7268 async reset API with useFieldArray (#7269)
🏛️ build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7262)
huge thanks goes to @evocateur