Search code examples
reduxresetredux-form

Can i reset multiple forms by calling reset once in redux form


can i reset multiple form by dispatching the reset function once? When an action is dispatched i want to reset three forms? Can i invoke the reset function like this? reset('form12', 'form132', 'form2332')


Solution

  • The provided action-creator doesn't support multiple forms at once, but you could create your own reusable thunk:

    const reset = (...forms) => dispatch => {
        forms.forEach(form => dispatch(reset(form));
    }