React-redux-form: combineForms with other reducers

Created on 19 Sep 2016  路  5Comments  路  Source: davidkpiano/react-redux-form

V1 beta 10.
How can I combine the RRF reducers with other reducers?

Vanilla example:

const store = createStore(combineForms({
  user: {},
}), applyMiddleware(thunk));

I tried:

const store = createStore({
  // ...
  nav: navReducer, 
  rrf: combineForms({
    user: {},
  })
}, applyMiddleware(thunk));

And:

const store = createStore({
  // ...
  nav: navReducer, 
  ...combineForms({
    user: {},
  })
}, applyMiddleware(thunk));

Doesn't work.

I know that the question is probably stupid.
Thanks

Most helpful comment

I think this should be added to https://davidkpiano.github.io/react-redux-form/docs/guides/quickstart.html since it's much more common to have other reducers than not.

All 5 comments

const store = createStore(combineReducers({
  deep: combineForms({
    user: initialUserState,
    goat: initialGoatState,
  }, 'deep'),
}));

@venelin-mihaylov I can't understand your solution, where you put navReducer?

@max-mykhailenko

const store = createStore(combineReducers({
  nav: navReducer, // <== here
  foo: fooReducer,
  bar: barReducer,
  deep: combineForms({
    user: initialUserState,
    goat: initialGoatState,
  }, 'deep'),
}));

I think this should be added to https://davidkpiano.github.io/react-redux-form/docs/guides/quickstart.html since it's much more common to have other reducers than not.

@romseguy I can add it to the FAQs - would you mind opening a ticket for tracking that addition to the documentation?

Was this page helpful?
0 / 5 - 0 ratings