Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using connect from react-redux with reduxForm HOC throws an error #4755

Open
manan30 opened this issue Dec 3, 2021 · 0 comments
Open

Using connect from react-redux with reduxForm HOC throws an error #4755

manan30 opened this issue Dec 3, 2021 · 0 comments
Labels

Comments

@manan30
Copy link

manan30 commented Dec 3, 2021

Subject of the issue

Using connect from react-redux with reduxForm HOC throws an error

Your environment

Software Version(s)
redux-form 8.3.8
redux 3.7.2
react-redux 7.2.4
react 16.14
react-dom 16.14

Steps to reproduce

Not sure why the component breaks when I use it like this

export default reduxForm({
  validate
  enableReinitialize: true,
})(connect(mapStateToProps, mapDispatchToProps)(Form));

However, doing this does work, but the Form component does not get access to any of the mapStateToProps and mapDispatchToProps values

export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(
  reduxForm({
    validate,
    enableReinitialize: true
  })(Form),
);

A reproducible demo: https://codesandbox.io/s/redux-form-simple-example-6hd1g?file=/index.js

Expected behaviour

The component should render without crashing the app

Actual behaviour

Here is the error that I get

Screen Shot 2021-12-03 at 12 02 28 AM

@manan30 manan30 added the bug label Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant