Open sraza295 opened 4 years ago
const required = value => (value ? undefined : ' This is a required field.'); const confirmPassword = value => (value!=required ? undefined : ' Did not match.');
<Field customStyle={styles.inputBox} required component={InputField} validations={[required]} name="newPassword" value={this.state.newPassword} onChangeText={val => this.setState({newPassword: val})} placeholder="New Password" secureTextEntry={true} /> <Field customStyle={styles.inputBox} required component={InputField} validations={[confirmPassword]} name="confirmPassword" value={this.state.confirmPassword} onChangeText={val => this.setState({confirmPassword: val})} placeholder="Confirm Password" secureTextEntry={true} />
const required = value => (value ? undefined : ' This is a required field.'); const confirmPassword = value => (value!=required ? undefined : ' Did not match.');