react-native-form-validator
react-native-form-validator copied to clipboard
this.validate is not a function" in TypeError: this.validate is not a function << at ...
Perhaps I'm not getting something, nothing in this package seems to work at all.
this.validate is not a function" in TypeError: this.validate is not a function << at _onSubmit
_onSubmit() {
this.validate({
emailField: {email: true, required: true},
passwordField: {required: true}
});
}
...
<TextInput
ref="emailField" deviceLocale="fr"
style={AppStyles.input}
keyboardType="email-address"
placeholder="Email Address"
onChangeText={(emailField) => this.setState({emailField})} value={this.state.emailField}
/>
Can you provide all your file ?
import ValidationComponent from 'react-native-form-validator'; // you need to import
class RegisterScreen extends ValidationComponent {} // make sure you change the component to ValidationComponent
_onSubmit() {
this.validate({
emailField: {email: true, required: true},
passwordField: {required: true}
});
}
WILL WORK FINE @arochedy @asdf23 @solved