react-server icon indicating copy to clipboard operation
react-server copied to clipboard

[PSA][Redux][ReduxForm] - bugs with using redux-form

Open pr1ntr opened this issue 8 years ago • 0 comments

I ran into a bug using redux-form ^v6. Basically v6 of redux form requires using react-hot-loader@3+ (@next).

The issue this causes with [email protected] is that if you try to make a form component as a separate module and import into a parent it will give you a cannot read property 'wrapped' of undefined error. This has to do with how modules are handles between the different versions of react-hot-loader.

If updating react-hot-loader is not something the user can do (i.e., using react-server). There is a work around here

@nygardk had given this solution:

Works:

export default { test: FormComponent };
...
import FormComponent from 'FormComponent';

<FormComponent.test />

Does Not Work:

export default FormComponent;
...
import FormComponent from 'FormComponent';

<FormComponent />

Essentially you cant have your form component be a default export.

pr1ntr avatar Apr 06 '17 19:04 pr1ntr