Skip to content
Source
Sign inSign up
TanStack/form

Fix #2377: fine-grained reactivity for `FormGroup` #2404

Openmax-te(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/2404/headopened

Showing 8 changed files with 12 additions and 0 deletions (loading 5).

x
0 of 8 viewed, 8 left
5 additions and 0 deletions.changeset/quiet-groups-render.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/react-form': patch
+---
+​
+Rerender `FormGroup` only when group state it reads changes, instead of on every field change in the group.
5 additions and 0 deletions.changeset/quiet-preact-groups-render.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/preact-form': patch
+---
+​
+Rerender `FormGroup` only when group state it reads changes, instead of on every field change in the group.
2 additions and 0 deletionsdocs/framework/preact/guides/form-groups.mdModified
View file
@@ -175,3 +175,5 @@
- `group.state.meta.isGroupValid`: `true` when the group-level validators have no errors
- `group.state.meta.isValid`: `true` when both the field-level and group-level validators have no errors
- `group.state.meta.isSubmitting`: `true` when the group is in the process of being submitted
+​
+A group only rerenders when a part of `group.state` that it has read changes. A group that renders only `form.Field`s therefore does not rerender while those fields are edited; each field rerenders on its own.
docs/framework/react/guides/form-groups.mdModified
View file
Loading the diff
packages/preact-form/src/useFormGroup.tsxModified
View file
Loading the diff
packages/preact-form/tests/useFormGroup.test.tsxModified
View file