Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
// custom rule will have name 'isPasswordMatch'
ValidatorForm.addValidationRule('isPasswordMatch', (value) => {
const { formData } = this.state;
if (value !== formData.password) {
return false;
}
return true;
});
}
componentWillMount() {
ValidatorForm.addValidationRule('isIP', isIP);
ValidatorForm.addValidationRule('isHostname', isHostname);
ValidatorForm.addValidationRule('isOptionalIP', optional(isIP));
}
componentDidMount() {
ValidatorForm.addValidationRule("isPaletteNameUnique", value =>
this.props.palettes.every(
({ paletteName }) => paletteName.toLowerCase() !== value.toLowerCase()
)
);
}
handleChange(evt) {
componentWillMount() {
ValidatorForm.addValidationRule('uniqueUsername', this.props.uniqueUsername);
}
componentWillMount() {
ValidatorForm.addValidationRule('isIP', isIP);
ValidatorForm.addValidationRule('isHostname', isHostname);
ValidatorForm.addValidationRule('isOptionalIP', optional(isIP));
}
componentDidMount() {
ValidatorForm.addValidationRule("isColorNameUnique", value =>
this.props.colors.every(
({ name }) => name.toLowerCase() !== value.toLowerCase()
)
);
ValidatorForm.addValidationRule("isColorUnique", value =>
this.props.colors.every(({ color }) => color !== this.state.currentColor)
);
}
updateCurrentColor(newColor) {
componentWillMount() {
ValidatorForm.addValidationRule('isIPOrHostname', or(isIP, isHostname));
}
componentDidMount() {
ValidatorForm.addValidationRule('isPasswordMatch', (value) => {
if (value !== this.state.password) {
return false
}
return true
})
}
componentDidMount() {
ValidatorForm.addValidationRule('isPasswordMatch', (value) => {
if (value !== this.state.password) {
return false
}
return true
})
}
componentWillMount() {
ValidatorForm.addValidationRule('isIP', isIP);
ValidatorForm.addValidationRule('isHostname', isHostname);
ValidatorForm.addValidationRule('isOptionalIP', optional(isIP));
}