title: Pass parameters to mapDispatchToProps()
body: <p>I can't lie, i'm a bit confused about react-redux. I think lot of the actions require parameters (for an example deleting items from the store), but even if i'm still reading about how to dispatch from component in that way to pass a parameter, about 2 hours now, i didn't get any answers. I was tried with <code>this.props.dispatch</code> and with <code>mapDispatchToProps</code>, i always get the <code>this.props... is not a function</code> message. Here's what i'm trying to do:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  const getTheArray = (array) =&gt; {
      return {
        type: 'GET_ARRAY',
        array
      }
    }
      
      class Example extends......
      
      componentDidUpdate(){
      //i have a button, and when it clicked, turns the status: 'deleted'
          if (this.state.status === 'deleted'){
              fetch('http://localhost:3001/deleteitem', {
                  method: 'post',
                  headers: {'Content-Type': 'application/json'},
                  body: JSON.stringify({
                      id: this.props.id
                  })
              })
              .then(res =&gt; res.json())
              .then(data =&gt; this.props.deleteFromArray(data))
              .catch(err =&gt; console.log(err)) 
          }
      }
  
  
  
  
  function mapStateToProps(state) {
      return {
          array: state.array
      };
  }
  function mapDispatchToProps(dispatch) {
      return({
          deleteFromArray: (array) =&gt; {dispatch(getTheArray(array))}
      })
  }
    
  export default connect(mapStateToProps, mapDispatchToProps)(Example);</code></pre>
  </div>
  </div>
  </p>
  
  <p>It isn't the only place where i need to dispatch with an action, where the action's object's properties depending on another property passed to the function, so i really want to do, what's the best way to pass property to action, and dispatch it within a react component.</p>