this.validate is undefined
Hello i have just started using this. However i cann't perform simple validation

I have extended from ValidationComponent. Any idea what i might be doing wrong
export default class LoginComponent extends ValidationComponent {
static navigationOptions = { title: 'Login Screen' };
constructor(props) {
super(props);
this.state = {
userName: '',
password: '',
// navigation :this.props.navigation,
};
loginTapped() {
this.validate({
userName: { required: true },
password: { email: true }
});
Hi @hassanrazakhalid, check if node_modules/react-native-form-validator it is installed, after the import => import ValidationComponent from 'react-native-form-validator';
Exact same issue here. Using Expo 23, react 16 Everything installed and being imported
I have the same issue, did you found any solution plz ?
i have the same issue can any one found solution?
add this.loginTapped = this.loginTapped.bind(this); in constructor.. like this constructor(props) { super(props);
this.state = {
userName: '',
password: '',
// navigation :this.props.navigation,
};
this.loginTapped = this.loginTapped.bind(this);
}
Facing same issue, any solution for this?
Use this
_onPressButton = () => {
this.validate({
name: { minlength: 3, maxlength: 7, required: true },
email: { email: true },
number: { numbers: true },
date: { date: 'YYYY-MM-DD' }
});
}
Instead of
_onPressButton(){
this.validate({
name: { minlength: 3, maxlength: 7, required: true },
email: { email: true },
number: { numbers: true },
date: { date: 'YYYY-MM-DD' }
});
}