I have an action and reducer that updates a global counter. This action is fired on a rapid interval. The reducer returns a new copy of the state for each action. The reduce
According to Redux implementation, connect
is pure and hence does a shallow comparison of the props that it needs to provide to the component i.e it implements a shouldComponentUpdate
method in its implementation and doesn't trigger a re-render for the connected component if the data returned from mapStateToProps
doesn't change.
It is important for Redux to monitor the state change for every change because then only it can take a decision whether to update or not.
Since a Pure component does a shallow comparison of state and props, you should make sure that your states are not highly nested