I am currently working on an React-Application where I use Immutable.js in my Redux-Reducers. The reducers will return the previous state as a reference if they have not changed it (as recommended).
If I now compared the previous state with the next state (state===nextState)
it would return true, since the reference has not changed, right?
Now if the reducer changed the state, it would return a new Immutable.js Map.
Doing the same comparision now it would return false, since it is a new Map.
Would it be reasonable to somehow detect prop changes within shouldComponentUpdate like that?
If so, is there a way to modify the react-redux connect function to use my custom shouldComponentUpdate method? Because apparently it is not possible to pass an Immutable.js Object as props to a component.