Closed skorp closed 7 years ago
Example of real usage?
render () {
const emailconfirm = 'isEqual:'+this.state.email;
return (
<Grid item xs={12} sm={4}>
<TextField
id="email"
name="email"
.......
validators={['required', 'isEmail']}
errorMessages={[formatMessage(formMessages.isRequired), formatMessage(formMessages.isValidEmail)]}
/>
</Grid>
<Grid item xs={12} sm={4}>
<TextField
name="email_confirmation"
.....
validators={['required', 'isEmail',emailconfirm]}
errorMessages={[formatMessage(formMessages.isRequired), formatMessage(formMessages.isValidEmail),'does not match']}
/>
</Grid>
)
)
You can achieve same behavior with matchRegexp
, or define your own rules so I don't see sense for this rule
isequal: for password or email confirmation