I have a component that I've passed through connect with a mapStateToProps argument to map one prop this.props.mainBuffer to a slice of my state tree from my store. Only the component is not rendering when I update that part of the state. (i realize that often the issue with redux is not changing the state immutably but I feel like I've done that).
My root (and only) reducer looks like:
function rootReducer(state = {}, action) {
switch (action.type) {
case NEW_BUFFER:
return Object.assign({}, {mainBuffer: action.samples})
default:
return state;
}
}
And the connect component is connected like this:
export default connect((state) => ({
mainBuffer: state.mainBuffer
}))(WaveformVisualizer);
I have been working with react-redux for a couple weeks now and this has always worked. Typically if I specify that a slice of the state tree state.MainBuffer and make sure to immutably update it in the reducer, the component will have a render triggered. But it is no longer happening and I can't see why.
dispatchmethod is getting called.WaveformVisualizer?action.samples? Is the value or reference changing ?