title: MapStateToProps not working
body: <p>I am trying to use redux with react. The mapStateToProps is not called.</p>
  
  <p>The dispatch calls are working properly, the action reaches the reducer and the newState is returned and the state of the store is modified. But mapStateToProps is not called and the component is not rerendering. </p>
  
  <pre><code>class Wrapper extends React.Component {
        updateChartData (data) =&gt; {
          ...logic...
          this.props.actions.chartDataAction(modifiedData);
          }
  }
  
  function mapStateToProps(state, ownProps) {
      return {
          chartData: state.chartData
          };
  }
  
  function mapDispatchToProps(dispatch) {
        return {
        actions: bindActionCreators(chartDataAction, dispatch)
        };
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(Wrapper);
  </code></pre>
  
  <p>The other classes that use updated state is as follows</p>
  
  <pre><code>class Chart extends React.Component {
      render(){
          /*console.log(this.props.chartData);*/
      }
  }
  
  function mapStateToProps(state, ownProps) {
      console.log(state);
      return {
          chartData: state.chartData
      };
  }
  
  let ChartComponent = withStyles(styles)(Chart);
  
  export default connect(mapStateToProps)(ChartComponent);
  </code></pre>
  
  <p>The action is as follows</p>
  
  <pre><code>export default function (state = [], action) {
  if (action.type === actionTypes.CHANGE_CHARTDATA) {
      return action.chartData;
  } else {
      return state;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The reducer is </p>
  
  <pre><code>export default function (state = [], action) {
      if (action.type === actionTypes.CHANGE_CHARTDATA) {
          return action.chartData;
      } else {
          return state;
      }
  }
  </code></pre>
  
  <p>I've even checked using redux dev tools. The chartData is being updated in the redux store. The chartData is properly passed to the Chart class and it renders on the first update. On consecutive dispatching, the chartData is updated in the redux store, but the mapStateToProps of Chart class is not called and the Chart class is not rerendering.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I'm trying to live update the chart and it does not render if the few entries in the chartData array are changed.</p>
  
  <p>I noticed that the chart component rerenders when the whole chartData is changed. But I want it to rerender if any part of the chartData is changed.</p>