Redux-form: Connect reduxForm with imported actions

Created on 8 Jun 2016  路  3Comments  路  Source: redux-form/redux-form

Im looking for a way to import my actions in the export of the reduxForm. To make it more clear, I have:

export default reduxForm({
  form: 'synchronousValidation',
  fields,
  validate
})(SynchronousValidationForm)

and my goal is to include the actions, like we do with connect, like so:

export default connect(mapStateToProps, actions)(Statistics);
question

Most helpful comment

Simply use connect!

import {compose} from "redux"
import {connect} from "react-redux"
import {reduxForm} from "redux-form"

// ...

export default compose(
  connect(mapStateToProps, actions),
  reduxForm({
    form: 'synchronousValidation',
    fields,
    validate
  })
)(SynchronousValidationForm)

All 3 comments

Simply use connect!

import {compose} from "redux"
import {connect} from "react-redux"
import {reduxForm} from "redux-form"

// ...

export default compose(
  connect(mapStateToProps, actions),
  reduxForm({
    form: 'synchronousValidation',
    fields,
    validate
  })
)(SynchronousValidationForm)

Thank you, works like a charm :)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanewho picture shanewho  路  3Comments

chienvuhoang picture chienvuhoang  路  3Comments

rob-mcgrail picture rob-mcgrail  路  3Comments

mauvew picture mauvew  路  3Comments

penteleq picture penteleq  路  3Comments