How to mount the redux-form further down in a nested state structure?

Viewed 276

I am stuck here on how to mount the redux-form reducer at the right place.

I have this initial state for a namespace called person (among many other namespaces in the app), something like this:

{
  personList: [],
  creatingNewPerson: false,
  newPerson: {}
}

the newPerson state is a form. How can I tell to have a redux-reducer acting on the newPerson state alone?

sure, you could do something like

combineReducers({
  person: personReducer, // that's a reducer using the above json
  newPerson: formReducer // import { reducer as formReducer } from 'redux-form'
})

but that's not the structure I am after. The state for the newPerson will be managed outside of the person state. But I want it to be managed inside.

It should be possible when the states redux-form is managing are JSON serializable.

How can this be achieved? Hope I made myself clear enough?

1 Answers
Related