I'm using redux-immutable
and need to connect()
multiple property in my component.
this is gameStore reducer initialState:
const initialState = Immutable.fromJS({
isPlaying: null,
level: 0,
remainTime: 120,
nextLevelUp: 40 ,
requiredGoods: CROISSANT_CHOCOLATE,
score: 0,
renderingObjects : [],
})
and component connect()
:
@connect((state) => ({
renderingObjects: state.getIn(['gameStore', 'renderingObjects']).toJS(),
isPlaying: state.getIn(['gameStore', 'isPlaying']).toJS(),
}
))
But getting error:
Uncaught TypeError: Cannot read property 'toJS' of null
What's wrong with that?