title: If then statements in mapStateToProps
body: <p>I was wondering if there was a way to conditionally return state values in mapStateToProps given prop information. See below for some sample code. I am getting some unexpected parsing errors. Is there a way to do something like this? Thanks.</p>
  
  <pre><code>const mapStateToProps = (state, ownProps) =&gt; (
    if (ownProps.name === "alpha") {
      return {
        data: state.alpha.data
      }
    } else if (ownProps.name === "beta") {
      return {
        data: state.beta.data    
      }
    } else {
      return null;
    }
  );
  </code></pre>