Modules: enhanced-redux-form/enhancedFormWizard

Methods


enhancedFormWizard(wizardFormConfig)

Adds multi-step form functionality to a component. For general usage instructions, please refer to Wizard Forms.

Parameters:
Name Type Description
wizardFormConfig object

Configuration object for the wizard

Properties
Name Type Argument Description
name string

A unique name for this wizard

onSubmit function

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
destroyOnUnmount boolean <optional>

If false, will not destroy the wizard form state when this component is unmounted. Defaults to true

generalErrorMessage string <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.

transformApiFieldNames string <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);