Q: Redux react immutable setIn element changes whole list I have this reducer in redux:
let index = state.items.findIndex(item => item.get('_id') == action.id);
let list = state.items.setIn([index, "selected"], action.selected)

return {
    ...state,
    items: list
}

In this case, when Im looking on the redux changes, I see that the whole list is changed, then all my view is reders instead of the specific item.
What am I doing wrong?
UPDATE:
I changed to updateIn, now my state shows that only one element is updated, but still my whole app is renders instead of the specific element:
<Row style={styles.row} key={item.get('_id')} item={item} selected={item.get('selected')}
                        onSelect={this.props.onRowSelect}/>


A: It looks like you are not using reducer composition. I would strongly encourage that as it makes each reducer a lot easier to understand: http://redux.js.org/docs/api/combineReducers.html
Without seeing how your component is mapped to the state it is hard to tell what is happening here, but I believe the root of your problem is that what you return from your reducer will always be a new object.


*

*Returned state will be a new object as you've merged the old state with a new list.

*Items will be a new object as part of what immutablejs does is make sure that if you change a child inside it, that change cascades upwards touching all parents.

*Finally the individual items you updated will be new objects.


I suspect you need to change a selector or mapStateToProps function to stop it from getting items which as it will always have changed, thus always causing a rerender.
