To use form actions, set
name property in use-form settings:
createFormActions function with the same form name as specified in
After that, you can use
demoFormActions to change form state from anywhere in your application.
For example, after a fetch request or after a user interaction with a component that does not have access
to the form state:
Form name must be a string that contains only letters, numbers and dashes:
Note that form names must be unique, if you have multiple forms with the same name, form actions will update the state of all forms with the same name.
createFormActions function returns an object with the following methods:
All methods work similar to use-form hooks methods – functions accept the same arguments but do not return anything.