NativeBase-KitchenSink icon indicating copy to clipboard operation
NativeBase-KitchenSink copied to clipboard

Button onPress not giving field values using redux-form and floating Input

Open xRahul opened this issue 6 years ago • 1 comments

Using example: http://docs.nativebase.io/docs/examples/ReduxFormExample.html The example does not actually submit the form. When trying to see the values on button press, I'm getting no field values-

Form-


const FloatingInput =
  ({ input, label, type, secure, returnKeyType, meta: { touched, error, warning } }) => {
    var hasError = false
    if (error !== undefined) {
      hasError = true
    }
    return (
      <Item floatingLabel error={hasError}>
        <Label>{label}</Label>
        <Input {...input}
          returnKeyType={returnKeyType}
          secureTextEntry={secure}
        />
      </Item>
    )
  }


<Form>
        <Field
          name='email'
          label='Email Address'
          component={FloatingInput}
        />
        <Field
          name='password'
          label='Password'
          secure
          component={FloatingInput}
        />
        <Button block primary
          style={{ margin: 15, marginTop: 50 }}
          onPress={(values) => console.log('submitting form', values)}
        >
          <Text>Login</Text>
        </Button>
</Form>
export default reduxForm({
  form: 'login'
})(LoginForm)

Console log shows this instead of the values-

submitting form
Proxy {dispatchConfig: Object, _targetInst: FiberNode, nativeEvent: Object, type: undefined, target: 30, …}

imports-

import React, { Component } from 'react'
import { Form, Button, Text } from 'native-base'
import { Field, reduxForm } from 'redux-form'

Can anyone tell me what I'm missing?

xRahul avatar Mar 17 '18 05:03 xRahul

@xRahul Can you revisit this issue with latest dependencies?

SupriyaKalghatgi avatar Feb 20 '19 06:02 SupriyaKalghatgi