Hello, I'm trying to get a setstate but when I run it it returns me which is not a function
renderInput({ input, label, type, meta: { touched, error, warning } }) {
onChangeTextDestino = async (param) => {
try {
this.setState({strEmail: param})
Alert.alert(this.state.strEmail)
} catch (e) {
console.log("error", e)
}
}
return (
<View>
<Item error={error && touched} rounded style={styles.inputGrp}>
<Icon
active
name={input.name === "email" ? "mail" : "unlock"}
style={{ color: "#fff" }}
/>
<Input
ref={c => (this.textInput = c)}
placeholderTextColor="#FFF"
style={styles.input}
placeholder={input.name === "email" ? "Email" : "Senha"}
secureTextEntry={input.name === "password" ? true : false}
onChangeText={text => this.onChangeTextDestinos(text)}
{...input}
/>
{touched && error
? <Icon
active
style={styles.formErrorIcon}
onPress={() => this.textInput._root.clear()}
name="close"
/>
: <Text />}
</Item>
{touched && error
? <Text style={styles.formErrorText1}>
{error}
</Text>
: <Text style={styles.formErrorText2}>error here</Text>}
</View>
);
}
This component is called this:
<Field
name="email"
component={this.renderInput}
type="email"
validate={[email, required]}
/>
How do I pass this function to the props?
component={this.renderInput}