Comparing version 0.10.3 to 0.10.4
@@ -62,3 +62,3 @@ 'use strict'; | ||
fieldValue: _fieldValue, | ||
validate: this.validate | ||
validate: this.validateField | ||
}); | ||
@@ -94,3 +94,3 @@ | ||
value: _value, | ||
validate: this.validate | ||
validate: this.validateField | ||
}); | ||
@@ -145,2 +145,10 @@ this.setState({ | ||
this.validateField = function (value) { | ||
var errorMessage = _this2.validate(value); | ||
_this2.setState({ | ||
errorMessage: errorMessage | ||
}); | ||
return errorMessage; | ||
}; | ||
this.propagateValue = function (fieldValue) { | ||
@@ -147,0 +155,0 @@ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this2.props; |
{ | ||
"name": "formact", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "A React Set of Form Components with Context", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -55,3 +55,3 @@ // @flow | ||
fieldValue, | ||
validate: this.validate, | ||
validate: this.validateField, | ||
}) | ||
@@ -65,2 +65,10 @@ | ||
validateField = (value: FieldValue): string => { | ||
const errorMessage = this.validate(value) | ||
this.setState({ | ||
errorMessage, | ||
}) | ||
return errorMessage | ||
} | ||
componentWillUnmount() { | ||
@@ -85,3 +93,3 @@ if (this.context && this.context.removeField) { | ||
value, | ||
validate: this.validate, | ||
validate: this.validateField, | ||
}) | ||
@@ -88,0 +96,0 @@ this.setState({ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216817
1345