-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined is not a function (evaluating 'this.validate') #1
Comments
Hi @ridhofh ! The validate methods doesn't return a promise. This is synchronous operation. |
so, what must i do, to run validate function from ValidationComponent? |
Sorry for the delay, you just have to extend ValidationComponent to your custom React Component and call : this.validate() in your click handler. The validate methods will populate some validation informations in the root of your component. |
I'm having this issue too. Could you provide some sample code? |
see the documentation:
|
getting the same error |
import React, { Component } from 'react'; export default class App extends ValidationComponent { constructor(props) { _onPressButton = () => { } } } } _validateForm() { render() {
} } |
Use this Instead of |
after using arrow function too it gives same error |
You have to use 'bind' :
|
thank you@DheereshSinghKarki its working for me |
I got error in _onPressButton, it refers to :
_onPressButton() {
// Call ValidationComponent validate method
this.validate({
userEmail: {email: true, minlength:6, required: true},
userPassword: {minlength:6, required: true}
}).then(Actions.index());
}
The text was updated successfully, but these errors were encountered: