react-redux-form
react-redux-form copied to clipboard
Reading state from ArrayMapNode
Hi,
I'm using react-boilerplate and I'm unable to make rrf to work in elegant way as I would like to. I found root cause (at least looking at how it works on rrf examples).
mapStateToProps in fieldset-component.js state is map of forms e.g.

However, in my bolierplate app, forms state is in an array of state nodes, which failes for rrf to read actual form from it.
This is state value received in mapStateToProps

If I do state = state.get('forms') than I'll get expected map of objects otherwsie I'll end up with error: Unable to create Form component. Could not find form for "dynamic.user" in the store.
Here's my setup:
reducer/forms.js
const initialUserState = fromJS({
name: ''
});
export default combineForms({
user: initialUserState
}, 'dynamic');
mainReducer.js
export default function createReducer(injectedReducers) {
return combineReducers({
...rootReducer,
...injectedReducers
});
}
store.js
const middlewares = [
sagaMiddleware,
thunk,
routerMiddleware(history)
];
const enhancers = [
applyMiddleware(...middlewares)
];
const store = createStore(
createReducer(),
fromJS(initialState),
composeEnhancers(...enhancers)
);
Have you found a solution? Please let me know because I'm having the same issue