Skip to content
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 '(0, _reactNativeFormValidator.Validate)') #16019

Closed
AAGSICON opened this issue Sep 20, 2017 · 1 comment
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@AAGSICON
Copy link

screenshot_2017-09-20-08-33-19-48

import React, { Component } from 'react';
import { NativeModules } from 'react-native';
import DatePicker from 'react-native-datepicker'
import ValidationComponent, {validate} from 'react-native-form-validator';
import { Text, TextInput, View, Button, Form, NativeAppEventEmitter, Camera, Alert } from 'react-native';

export default class Registration extends Component {

constructor(props) {
super(props);
this.state = {text: '', date:""};
}
_onPressButton() {
// Call ValidationComponent validate method
validate({
Username: {minlength:3, maxlength:7, required: true},
email: {email: true},
lastName: {required: true},

});
}

render() {
return (
<View style={{padding: 30}}>
<TextInput

        Name="firstName"
         style={{height: 40}}
          autoFocus={true}
          autoCapitalize="none"
          autoCorrect={false}
          placeholder="First Name"
          onChangeText={(firstName) => this.setState({firstName})}
        />

      <TextInput
      Name="lastName"
       style={{height: 40}}
        autoFocus={false}
        autoCapitalize="none"
        autoCorrect={false}
        placeholder="Last Name"
        onChangeText={(lastName) => this.setState({lastName})}
      />
      <DatePicker
        style={{width: 800}}
        date={this.state.date}
        mode="date"
        placeholder="Select Date of Birth"
        format="YYYY-MM-DD"
        confirmBtnText="Confirm"
        cancelBtnText="Cancel"
        customStyles={{
          dateIcon: {
            position: 'absolute',
            left: 0,
            top: 4,
            marginLeft: 0
          },
          dateInput: {
            marginLeft: 36
          }
      // ... You can check the source to find the other keys.
    }}
    onDateChange={(date) => {this.setState({date: date})}}
  />
      <TextInput
      Name="email"
       style={{height: 40}}
       autoFocus={false}
       autoCapitalize="none"
       autoCorrect={false}
       placeholder="Email"
       onChangeText={(email) => this.setState({email})}
     />

      <TextInput
      Name="Username"
      style={{height: 40}}
      placeholder="Username!"
      onChangeText={(text) => this.setState({text})}
    />

       <TextInput
     Name="password"
      style={{height: 40}}
      placeholder="password!"
      secureTextEntry={true}
      autoCapitalize="none"
      autoCorrect={false}
      onChangeText={(text) => this.setState({text})}
    />

      <TextInput
      Name="passwordConfirmation"
       style={{height: 40}}
        secureTextEntry={true}
        autoCapitalize="none"
        autoCorrect={false}
        placeholder="Password Confirmation"
        onChangeText={(passwordConfirmation) => this.setState({passwordConfirmation})}
      />

   <Button
onPress={this._onPressButton}
 title="Press Me"

/>

    );
}

}

@sscaff1
Copy link
Contributor

sscaff1 commented Sep 21, 2017

Seems like this needs to be address in react-native-form-validator repo. There already exists an issue that is similiar perscrew/react-native-form-validator#1.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants