title: ReactNative - get values from redux-form
body: <p>I use ReactNative + redux + redux-form.</p>
  
  <p>In my login.js screen, I have this :</p>
  
  <pre><code>function bindAction(dispatch) {
      return {
          actions: bindActionCreators(loginActions, dispatch)
      };
  }
  function mapStateToProps(state) {
      return state.loginReducer
  }
  export default connect(mapStateToProps, bindAction)(reduxForm({
      form: "login",
      initialValues: {
          email: "test@test.fr",
          password: "123123"
      }
  })(LoginForm));
  </code></pre>
  
  <p>And my form is :</p>
  
  <pre><code>&lt;Field
      name="email"
      component={this.renderInput}
      type="email"
      validate={[email, required]}
  /&gt;
  &lt;Field
      name="password"
      component={this.renderInput}
      type="password"
      validate={[minLength6, maxLength15, required]}
  /&gt;
  </code></pre>
  
  <p>I want to call the function <code>login()</code> with the values of my fields.</p>
  
  <p>I tried :</p>
  
  <pre><code>login() {
      if (this.props.valid) {
          this.props.actions.loginUser(selector(this.state, 'email', 'password'));
      }
  }
  </code></pre>
  
  <p>With :</p>
  
  <pre><code>const selector = formValueSelector("login")
  </code></pre>
  
  <p>I have no errors, but my fields are always empty in the <code>login()</code> function.</p>
  
  <p>To be honest, I read the doc, but I am not sure how to use correctly redux-form. I need to use something else to get the field value ? Thanks.</p>
  
  <p>** <strong>EDIT</strong> **</p>
  
  <p>Regarding to some examples, I use now this code :</p>
  
  <pre><code>&lt;Button
      style={styles.loginBtn}
      disabled={this.props.loading}
      onPress={handleSubmit(this.login)}
  &gt;
  ...
  &lt;/Button&gt;
  </code></pre>
  
  <p>And now, I can access form data in my function :</p>
  
  <pre><code>login(data) {
      if (this.props.valid) {
          this.props.actions.loginUser({
              username: data.email, 
              password: data.password
          });
           ....
  </code></pre>
  
  <p>I don't know if it is the correct way, in react-native, I didn't find any example using <code>&lt;form&gt;</code> elements, but it works.</p>