luigiplr / react-router-redux-rxjs-code-splitting

An example React Redux app using React Router & RxJS for route management & chunk loading respectively.
https://luigiplr.github.io/react-router-redux-rxjs-code-splitting
GNU General Public License v3.0
55 stars 11 forks source link

Usage with ReduxForm #7

Closed BeosFreak closed 6 years ago

BeosFreak commented 6 years ago

How do I provide the "form" reducer required by ReduxForm.

I've tried adding the following to registry.js, but it's not working.

import { reducer as form } from 'redux-form';
...
get initialReducers() {
    return combineReducers(this._reducers, form)
  }
BeosFreak commented 6 years ago

I tried moving the form object to the constructor of the Registry:

export default class Registry {
  constructor(baseReducers) {
    this._reducers = {form: formReducer} //baseReducers
  }

This way you only ever create the 'form' reducer once with the required keyword and never need to add it again, and it is working.