title: Redux pattern for getting state in action creator
body: <p>I've identified 2 patterns for getting state in an action creator and am wondering which is better:</p>
  
  <ol>
  <li>Use redux-thunk and getState</li>
  <li>mapStateToProps in the component and pass the state back to Redux when calling an action creator</li>
  </ol>
  
  <p>Example of each:</p>
  
  <pre><code>class SomeComponent {
      render() {
          return (
              &lt;Button onPress={this.props.networkCall}/&gt;
          )
      }
  }
  
  const mapDispatchToProps = {
      networkCall: actions.networkCall,
  }
  
  export default connect(undefined, mapDispatchToProps)(SomeComponent)
  </code></pre>
  
  <hr>
  
  <pre><code>export networkCall() {
      return (dispatch, getState) =&gt; {
          const { dataForNetworkCall } = getState().someReducer
          dispatch(pending())
          axios.get(`something/${dataForNetworkCall}/something2`)
              .then(() =&gt; {
                  dispatch(success())
              }
              ...
      }
  }
  </code></pre>
  
  <hr>
  
  <p>OR</p>
  
  <hr>
  
  <pre><code>class SomeComponent {
      render() {
          const { networkCall, dataForNetworkCall } = this.props
          return (
              &lt;Button onPress={networkCall(dataForNetworkCall)}/&gt;
          )
      }
  }
  
  function mapStateToProps(state) {
      const { dataForNetworkCall } = state.someReducer
      return { dataForNetworkCall }
  }
  
  const mapDispatchToProps = {
      networkCall: actions.networkCall,
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(SomeComponent)
  </code></pre>
  
  <hr>
  
  <pre><code>export networkCall(dataForNetworkCall) {
      return (dispatch) =&gt; {
          dispatch(pending())
          axios.get(`something/${dataForNetworkCall}/something2`)
              .then(() =&gt; {
                  dispatch(success())
              }
              ...
      }
  }
  </code></pre>
  
  <p>I feel like 2 is a bad idea because it involves passing state to the Component just to pass it back to Redux. However, there seems to be a lot of articles online saying option 1 is an anti-pattern (including <a href="https://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator">Dan Abramov himself saying it is an anti-pattern</a>). So, what is the "best" way?</p>