I do have a TextField component to take email as input.
<div className="form-group" style={styles.popupContainer}>
<label>
<IntlMessages id="DIC_SETTINGS_CLIENT_PIC_EMAIL" />
</label>
<label className="text-danger" style={styles.star_style}>
<sup>{"*"}</sup>
</label>
<TextField
error={errorInputs.email}
margin="normal"
fullWidth
id={"email"}
value={item.email}
onChange={this.handleEmailChange("email")}
onBlur={() => this.handleBlur("email")}
/>
</div>;
onChange()
handleEmailChange = email => event => {
let changedEmailValue = event.target.value;
switch (email) {
case "email":
let temp = this.state.item;
temp.email = changedEmailValue;
this.setState({
item: temp
});
break;
}
};
How to write code for validation of email in this context