remix-validated-form 2.0.0-beta.2 → 2.0.0-beta.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.
@@ -1,9 +1,9 @@
1
1
  $ npm run build:browser && npm run build:main
2
2
 
3
- > remix-validated-form@2.0.0 build:browser
3
+ > remix-validated-form@2.0.0-beta.2 build:browser
4
4
  > tsc --module ESNext --outDir ./browser
5
5
 
6
6
 
7
- > remix-validated-form@2.0.0 build:main
7
+ > remix-validated-form@2.0.0-beta.2 build:main
8
8
  > tsc --module CommonJS --outDir ./build
9
9
 
@@ -1,78 +0,0 @@
1
- $ tsc --module ESNext --outDir ./browser --watch
2
- c8:26:39 PM - Starting compilation in watch mode...
3
-
4
-
5
- 8:26:40 PM - Found 0 errors. Watching for file changes.
6
- c8:29:35 PM - File change detected. Starting incremental compilation...
7
-
8
-
9
- 8:29:35 PM - Found 0 errors. Watching for file changes.
10
- c8:30:13 PM - File change detected. Starting incremental compilation...
11
-
12
-
13
- 8:30:13 PM - Found 0 errors. Watching for file changes.
14
- c8:30:36 PM - File change detected. Starting incremental compilation...
15
-
16
-
17
- 8:30:36 PM - Found 0 errors. Watching for file changes.
18
- c8:31:03 PM - File change detected. Starting incremental compilation...
19
-
20
-
21
- 8:31:03 PM - Found 0 errors. Watching for file changes.
22
- c8:33:28 PM - File change detected. Starting incremental compilation...
23
-
24
- src/ValidatedForm.tsx(67,7): error TS2304: Cannot find name 'defaultsFromValidationError'.
25
- src/ValidatedForm.tsx(69,23): error TS2304: Cannot find name 'defaultsFromValidationError'.
26
- src/ValidatedForm.tsx(70,10): error TS2304: Cannot find name 'defaultsFromValidationError'.
27
- src/ValidatedForm.tsx(71,30): error TS2304: Cannot find name 'defaultsFromValidationError'.
28
- src/ValidatedForm.tsx(71,60): error TS2304: Cannot find name 'defaultValues'.
29
- src/ValidatedForm.tsx(152,58): error TS2554: Expected 0-1 arguments, but got 2.
30
-
31
- 8:33:28 PM - Found 6 errors. Watching for file changes.
32
- c8:35:37 PM - File change detected. Starting incremental compilation...
33
-
34
- src/ValidatedForm.tsx(69,5): error TS1156: 'const' declarations can only be declared inside a block.
35
- src/ValidatedForm.tsx(71,10): error TS2304: Cannot find name 'defaultsFromValidationError'.
36
- src/ValidatedForm.tsx(72,10): error TS2454: Variable 'subactionsMatch' is used before being assigned.
37
- src/ValidatedForm.tsx(72,28): error TS2304: Cannot find name 'defaultsFromValidationError'.
38
- src/ValidatedForm.tsx(72,58): error TS2304: Cannot find name 'defaultValues'.
39
-
40
- 8:35:38 PM - Found 5 errors. Watching for file changes.
41
- c8:51:56 PM - File change detected. Starting incremental compilation...
42
-
43
- src/ValidatedForm.tsx(69,5): error TS1156: 'const' declarations can only be declared inside a block.
44
- src/ValidatedForm.tsx(71,10): error TS2304: Cannot find name 'defaultsFromValidationError'.
45
- src/ValidatedForm.tsx(72,10): error TS2454: Variable 'subactionsMatch' is used before being assigned.
46
- src/ValidatedForm.tsx(72,28): error TS2304: Cannot find name 'defaultsFromValidationError'.
47
- src/ValidatedForm.tsx(72,58): error TS2304: Cannot find name 'defaultValues'.
48
-
49
- 8:51:56 PM - Found 5 errors. Watching for file changes.
50
- c8:52:01 PM - File change detected. Starting incremental compilation...
51
-
52
- src/ValidatedForm.tsx(69,5): error TS1156: 'const' declarations can only be declared inside a block.
53
- src/ValidatedForm.tsx(71,10): error TS2304: Cannot find name 'defaultsFromValidationError'.
54
- src/ValidatedForm.tsx(72,10): error TS2454: Variable 'subactionsMatch' is used before being assigned.
55
- src/ValidatedForm.tsx(72,28): error TS2304: Cannot find name 'defaultsFromValidationError'.
56
- src/ValidatedForm.tsx(72,58): error TS2304: Cannot find name 'defaultValues'.
57
-
58
- 8:52:01 PM - Found 5 errors. Watching for file changes.
59
- c8:53:29 PM - File change detected. Starting incremental compilation...
60
-
61
-
62
- 8:53:29 PM - Found 0 errors. Watching for file changes.
63
- c8:54:22 PM - File change detected. Starting incremental compilation...
64
-
65
-
66
- 8:54:22 PM - Found 0 errors. Watching for file changes.
67
- c8:54:40 PM - File change detected. Starting incremental compilation...
68
-
69
- src/ValidatedForm.tsx(157,42): error TS2345: Argument of type 'FieldErrorsWithData | null' is not assignable to parameter of type 'FieldErrorsWithData | undefined'.
70
- Type 'null' is not assignable to type 'FieldErrorsWithData | undefined'.
71
-
72
- 8:54:40 PM - Found 1 error. Watching for file changes.
73
- c8:54:56 PM - File change detected. Starting incremental compilation...
74
-
75
- src/ValidatedForm.tsx(70,20): error TS2322: Type 'null' is not assignable to type 'FieldErrorsWithData | undefined'.
76
- src/ValidatedForm.tsx(77,3): error TS2322: Type 'null' is not assignable to type 'FieldErrorsWithData | undefined'.
77
-
78
- 8:54:56 PM
@@ -76,7 +76,7 @@ export function ValidatedForm({ validator, onSubmit, children, fetcher, action,
76
76
  const formRef = useRef(null);
77
77
  useSubmitComplete(isSubmitting, () => {
78
78
  var _a;
79
- if (!fieldErrorsFromBackend) {
79
+ if (!fieldErrorsFromBackend && resetAfterSubmit) {
80
80
  (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.reset();
81
81
  }
82
82
  });
@@ -82,7 +82,7 @@ function ValidatedForm({ validator, onSubmit, children, fetcher, action, default
82
82
  const formRef = (0, react_2.useRef)(null);
83
83
  (0, submissionCallbacks_1.useSubmitComplete)(isSubmitting, () => {
84
84
  var _a;
85
- if (!fieldErrorsFromBackend) {
85
+ if (!fieldErrorsFromBackend && resetAfterSubmit) {
86
86
  (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.reset();
87
87
  }
88
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remix-validated-form",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "Form component and utils for easy form validation in remix",
5
5
  "browser": "./browser/index.js",
6
6
  "main": "./build/index.js",
@@ -158,7 +158,7 @@ export function ValidatedForm<DataType>({
158
158
  const defaultsToUse = useDefaultValues(fieldErrorsFromBackend, defaultValues);
159
159
  const formRef = useRef<HTMLFormElement>(null);
160
160
  useSubmitComplete(isSubmitting, () => {
161
- if (!fieldErrorsFromBackend) {
161
+ if (!fieldErrorsFromBackend && resetAfterSubmit) {
162
162
  formRef.current?.reset();
163
163
  }
164
164
  });