action
Specification
Action performed on the successful submit of the form.
This function is called only when the form is valid.
Definition
Parameters
Parameter name | Type | Description |
|
| Serialized fields of the form. |
|
| Reference to all fields. |
|
| Form component reference. |
action
function must always return a Promise.
Example
Simple example
You can use onSerialize
form prop to transform the serialized fields object prior to accepting them in the action
handler.
Example with Redux
You need to use a dedicated Redux middleware for the actions to return a Promise (i.e. redux-thunk
or redux-saga
).
Last updated