redfin/react-server

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

pr1ntr opened this issue · 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 react-hot-loader@1.3.1 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.