title: Re-rendering of connect()ed component based on mapStateToProps output
body: <p>In a React + Redux based project, I have a <code>connect()</code>ed component which checks user permissions via an API fetch. Fetched permissions are stored in the Redux store.</p>
  
  <p>The component basically looks like <code>&lt;Can check="..."&gt;...&lt;/Can&gt;</code>, which talks to our API (via Redux actions) to resolve the check. If the permission is granted, <code>this.props.children</code> is rendered, <code>null</code> otherwise.</p>
  
  <p>For that, <code>mapStateToProps()</code> computes a <code>passes</code> prop from authorization data in the store, which is checked in <code>&lt;Can /&gt;</code>s <code>render()</code> method. I utilize the <code>ownProps</code> parameter to <code>mapStateToProps()</code> to get the "stuff to check" and compute the <code>passes</code> flag.</p>
  
  <p>There's a bit of caching going on so I don't re-fetch on every component mount, and it basically works. Sometimes, though, the component will not re-render when the <code>passes</code> prop updates to <code>true</code> (it will however render after navigating away - using react router - and back again, so basically if the component is re-mounted).</p>
  
  <p>Do <code>connect()</code>ed components re-render if the output from <code>mapStateToProps()</code> changes? The docs for <code>react-redux</code>'s <code>connect()</code> say this:</p>
  
  <blockquote>
    <p>If ownProps is specified as a second argument, its value will be the props passed to your component, and mapStateToProps will be re-invoked whenever the component receives new props.</p>
  </blockquote>
  
  <p>Does that mean that passing in <code>ownProps</code> changes the rendering to only re-render if props change, or in any other way? How can I understand the note regarding memoization/returning a function from <code>mapStateToProps()</code>, or is that not even related?</p>
  
  <p>Thank you</p>