Skip to content

Commit

Permalink
Add cleanup for batch observer
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtiomTr committed Dec 3, 2024
1 parent 97fff6d commit e2a6bf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thick-pugs-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reactive-forms/core': patch
---

Add cleanup for batch observer
2 changes: 1 addition & 1 deletion packages/core/src/hooks/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export const useForm = <Values extends object>(initialConfig: FormConfig<Values>

useEffect(() => {
updateFormValidness(errors.getValues());
errors.watchBatchUpdates((batchUpdate) => {
return errors.watchBatchUpdates((batchUpdate) => {
if (batchUpdate.paths.length > 0) {
updateFormValidness(batchUpdate.values);
}
Expand Down

0 comments on commit e2a6bf3

Please sign in to comment.