Having issues with too many reredners, need Redux expert

I'm going to describe what's going on and make some claims that I need to be verified. If any Redux experts are here, I'd appreciate your input.

So, we have a store, that via websockets we get an array of objects. In the reducer, we just set the property to whatever was returned by the WS. Of course, this creates a new reference (we did something like `state.prop = action.payload`). So that caused a lot of issues, as we kept changing the reference, right? So my first assumption is, if you do this in reducer, no matter what you do with `createSelector`, it won't work, right? Since reference changes, `createSelector` has no power here.

First step would then be, to update array accordingly. Now we have another issue. If, let's say, we have an array in store: `[1, 2, 3]`, and we get from the web socket `[2, 3]`, we have to remove the `1` from store. Assumption number 2: no matter what you do in this case, if you remove something from array, the indexes will recalculate, which will cause a rerender, and `createSelector` again won't be helping us here. Is this correct? What are the best approach to remove stuff from array, if there actually is any way to optimize this?

Then, regarding the `createSelector`, when you try to get something by id, I don't understand completely the memozation here. Let's take this for example:

const selectItems = state => state.items

const selectItemId = (state, itemId) => itemId

const selectItemById = createSelector( [selectItems, selectItemId], (items, itemId) => items[itemId] )

const item = selectItemById(state, 42)

So my question here is, what happens, if I have an array of items, then iterate over them (using `map`) and create components that use `selectItemById `, and get value by prop?

I'm calling `selectItemById ` with different Ids in a for loop. Now if `state.items` stays the same, and call `selectItemById ` wih the ids 1, then 2, then 1 again, is 1 cached? Probably not, right?