You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3e5ed8e
Browse filesBrowse the repository at this point in the historyBrowse files
|`data` / `setData`| Current form values, typed to match the action's body schema. |
153
-
|`errors`| Field-level validation errors, keys typed to body field names. |
154
-
|`error`| Action error, or `null`. |
155
-
|`post`, `put`, `patch`, `delete`| Submit the form with that method. In React these are native form action callbacks. |
156
-
|`pending`|`true` while the submission is in flight. |
157
-
|`hasChanges`|`true` if form data differs from the current defaults. After a successful submit, defaults update to the submitted values so `hasChanges` becomes `false`. |
158
-
|`wasSuccessful`|`true` after a successful submission. Stays `true` until the next submission. |
159
-
|`recentlySuccessful`|`true` for 2 seconds after a successful submission. Useful for flash messages. |
|`data` / `setData`| Current form values, typed to match the action's body schema. |
153
+
|`errors`| Field-level validation errors, keys typed to body field names. |
154
+
|`error`| Action error, or `null`. |
155
+
|`post`, `put`, `patch`, `delete`| Submit the form with that method. In React these are native form action callbacks. |
156
+
|`pending`|`true` while the submission is in flight. |
157
+
|`hasChanges`|`true` if form data differs from the current defaults. After a successful submit, defaults update to the submitted values so `hasChanges` becomes `false`. |
158
+
|`wasSuccessful`|`true` after a successful submission. Stays `true` until the next submission. |
159
+
|`recentlySuccessful`|`true` for 2 seconds after a successful submission. Useful for flash messages. |
160
160
|`reset(...fields)`| Reset form data to the current defaults (last submitted values after success). Field names autocomplete. Pass `{ initial: true }` first to reset to the values passed to `useForm`. |
161
-
|`resetOnSuccess` (option) | When `true`, a successful submit resets both form data and defaults to the mount-time values. Useful for create forms that should clear after save. |
162
-
|`clearErrors(...fields)`| Clear validation errors. Field names autocomplete. |
163
-
|`clearError()`| Clear `error`. |
161
+
|`resetOnSuccess` (option) | When `true`, a successful submit resets both form data and defaults to the mount-time values. Useful for create forms that should clear after save. |
162
+
|`clearErrors(...fields)`| Clear validation errors. Field names autocomplete. |
163
+
|`clearError()`| Clear `error`. |
164
164
165
165
For a native React form, use `form.post`, `form.put`, `form.patch`, or `form.delete` as a native form action. For an awaitable mutation, use `action()`. In Vue, Svelte, and Solid, form submissions return `Promise<void>`; catch thrown errors or use your framework's error handling.
0 commit comments