title: Exactly when does a component update itself?
body: <p>As far as I know, when a new <code>prop</code> is received, a component is updated based on <code>shouldComponentUpdate</code> function. I have the following container:</p>
  
  <p>I am using redux, and I have the following inside my <code>container</code>.</p>
  
  <pre><code>function filterQuestions(allQuestions, answeredQuestions) {
    var filtered = _.reject(allQuestions, (q) =&gt; _.contains(answeredQuestions, q.question.id))
    return [...filtered]
  }
  
  const mapStateToProps = (state) =&gt; {    
    return {
      questions: filterQuestions(state.questions.questions, state.questions.answeredQuestions),
    }
  }
  </code></pre>
  
  <p>My intention is that the connected <code>component</code> only updates when the output of <code>filterQuestions(...)</code> changes. However, the component updates everytime when there's a change in the global <code>store</code>. If I get rid of <code>filterQuestions</code> and simply pass <code>state.questions</code>, it shows the expected behavior.</p>
  
  <p>I assume there's something wrong with the usage of <code>filterQuestions</code> but I am not sure exactly what is the issue. Can someone pinpoint it for me?</p>