NativeBase-KitchenSink
NativeBase-KitchenSink copied to clipboard
Button onPress not giving field values using redux-form and floating Input
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 Can you revisit this issue with latest dependencies?