Closed adasfan closed 7 years ago
This is only a warning. The full error reads:
[..] Unexpected properties will be ignored.
It says that there are reducers without corresponding state.
Does redux-immutable reconstruct state by creating root keys using the reducer names?
It does.
Thanks @gajus . Just a quick follow-up, so is it recommended/normal practice to pass parts of the state to the components as follows:
export default connect(state => ({
products: state.getIn(['reducer1', 'products']),
inStockOnly: state.getIn(['reducer2', 'isInStockOnly'])
}))(ProductTable);
products
and isInStockOnly
are keys of the state map before the reconstruction. Or is there a better pattern to use for passing the parts of state around?
Your example seems to be valid.
@gajus - what would be the preferred form of the initialState
that is passed to createStore
? If I pass it in Immutaple.Map
form it warns about not finding the keys in the form of reducer function names.
I have absolutely no idea, about this warning, Im getting it, and its stopping the app from loading. Sadly from here, and in True redux fashion, the explanations are far too obscure to follow.
If I pass an
initialState
like socreateStore(combineReducers({reducer1, reducer2}), initialState)
, I get:When I look at my state which is defined as
Immutable.Map
, I seereducer1
andreducer2
keys at the roots. Doesredux-immutable
reconstruct state by creating root keys using the reducer names?