Methods
-
enhancedFormWizard(wizardFormConfig)
-
Adds multi-step form functionality to a component. For general usage instructions, please refer to Wizard Forms.
Parameters:
Name Type Description wizardFormConfigobject Configuration object for the wizard
Properties
Name Type Argument Description namestring A unique name for this wizard
onSubmitfunction A submit handler that will be called after the last form step has been submitted. It will receive the following parameters:
- dispatch The redux dispatch function
- values An object containing the submitted form values of all form steps
destroyOnUnmountboolean <optional>
If false, will not destroy the wizard form state when this component is unmounted. Defaults to true
generalErrorMessagestring <optional>
When the API call comes back with an error that doesn't have the default error response shape, this message will be shown instead.
transformApiFieldNamesstring <optional>
A function that maps each field name in an API validation response to a field name in this form. Can be used to map flattened field names in the API back to nested names in redux-form.
- Source:
- Tutorials:
Returns:
A function that wraps a component in the wizard functionality
- Type
- function
Example
export default enhancedFormWizard({ name: 'onlineRegistration', onSubmit: (dispatch, values) => { ... }, })(OnlineRegistration);