@tanstack/react-form 0.19.1 → 0.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-form",
3
- "version": "0.19.1",
3
+ "version": "0.19.3",
4
4
  "description": "Powerful, type-safe forms for React.",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -43,7 +43,7 @@
43
43
  "@tanstack/react-store": "^0.3.1",
44
44
  "decode-formdata": "^0.4.0",
45
45
  "rehackt": "^0.0.3",
46
- "@tanstack/form-core": "0.19.1"
46
+ "@tanstack/form-core": "0.19.3"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": "^17.0.0 || ^18.0.0"
@@ -874,4 +874,30 @@ describe('useField', () => {
874
874
  await user.type(confirmPasswordInput, '1')
875
875
  expect(await findByText('Passwords do not match')).toBeInTheDocument()
876
876
  })
877
+
878
+ it('should handle deeply nested values in StrictMode', async () => {
879
+ function Comp() {
880
+ const form = useForm({
881
+ defaultValues: {
882
+ name: { first: 'Test', last: 'User' },
883
+ },
884
+ })
885
+
886
+ return (
887
+ <form.Field
888
+ name="name.last"
889
+ children={(field) => <p>{field.state.value ?? ''}</p>}
890
+ />
891
+ )
892
+ }
893
+
894
+ const { queryByText, findByText } = render(
895
+ <React.StrictMode>
896
+ <Comp />
897
+ </React.StrictMode>,
898
+ )
899
+
900
+ expect(queryByText('Test')).not.toBeInTheDocument()
901
+ expect(await findByText('User')).toBeInTheDocument()
902
+ })
877
903
  })