showing results for - "textinput is email type"
Liam
05 Aug 2018
1validate = (text) => {
2  console.log(text);
3  let reg = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
4  if (reg.test(text) === false) {
5    console.log("Email is Not Correct");
6    this.setState({ email: text })
7    return false;
8  }
9  else {
10    this.setState({ email: text })
11    console.log("Email is Correct");
12  }
13}
Hubert
01 Jul 2017
1<TextInput
2  placeholder="Email ID"
3  onChangeText={(text) => this.validate(text)}
4  value={this.state.email}
5/>