title: Passing values to action creator using Redux and React Native
body: <p>How can I send the values from the reduxForm fields to my login actionCreator so that I can generate a dispatch for authentication from there. Here is what I have so far. Basically on submit, I want the login action creator to be called with the values from the "form"
  <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>import React, {Component} from 'react';
  import {TouchableHighlight,Alert, AsyncStorage,StyleSheet,Text, TextInput, TouchableOpacity, View} from 'react-native';
  import {Actions} from 'react-native-router-flux';
  import { Field,reduxForm } from 'redux-form'
  import { connect } from 'react-redux'
  
  import { login } from '../../actions/user.js'
  
  
  // const submit = values =&gt; {
  //    authenticate()
  //    //login(values.email, values.password);
  // }
  
  const renderInput = ({ input: { onChange, ...restInput }}) =&gt; {
    return &lt;TextInput style={styles.input} onChangeText={onChange} {...restInput} /&gt;
  }
  
  const Authentication = (props) =&gt; {
   const { handleSubmit } = props
   const {login} = props
  
   const {
      container,
      text,
      button,
      buttonText,
      mainContent
    } = styles
    
      return (
         &lt;View style={styles.container}&gt;
            
           &lt;Text&gt;Email:&lt;/Text&gt;
           &lt;Field name="email" component={renderInput} /&gt;
           
           &lt;Text&gt;Password:&lt;/Text&gt;
           &lt;Field  name="password" component={renderInput} /&gt;
  
        &lt;TouchableOpacity onPress={handleSubmit(login)}&gt;
          &lt;Text style={styles.button}&gt;Submit&lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
  
  
        &lt;/View&gt;
      );
    
  }
  
  
  function mapStateToProps (state) {
    return {
      userData: state.userData
    }
  }
  
  function mapDispatchToProps (dispatch) {
    return {
      login: () =&gt; dispatch(login())
    }
  }
  
  
  
  Authentication = reduxForm({
    form: 'loginForm'  // a unique identifier for this form
  })(Authentication)
  
  // You have to connect() to any reducers that you wish to connect to yourself
  const AuthenticationComponent = connect(
    mapStateToProps,
    mapDispatchToProps
  )(Authentication)
  
  export default AuthenticationComponent</code></pre>
  </div>
  </div>
  </p>