@shopify/react-form-state
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -163,3 +163,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var onSubmit, _a, formData, mounted, result; | ||
var onSubmit, _a, formData, mounted, errors; | ||
return __generator(this, function (_b) { | ||
@@ -182,6 +182,9 @@ switch (_b.label) { | ||
case 1: | ||
result = _b.sent(); | ||
if (result) { | ||
this.updateRemoteErrors(result); | ||
errors = _b.sent(); | ||
if (!mounted) { | ||
return [2 /*return*/]; | ||
} | ||
if (errors) { | ||
this.updateRemoteErrors(errors); | ||
} | ||
this.setState({ submitting: false }); | ||
@@ -188,0 +191,0 @@ return [2 /*return*/]; |
@@ -527,3 +527,3 @@ # Building forms with FormState | ||
validateList, | ||
validateObject, | ||
validateNested, | ||
arrayUtils, | ||
@@ -565,3 +565,3 @@ } from '@shopify/react-form-state'; | ||
sku: lengthMoreThan(3, 'Must be longer than 3 characters'), | ||
firstVariant: validateObject({ | ||
firstVariant: validateNested({ | ||
option: required('required'), | ||
@@ -568,0 +568,0 @@ price: numericString('value must be numeric'), |
{ | ||
"name": "@shopify/react-form-state", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Manage react forms tersely and type-safe with no magic.", |
@@ -169,7 +169,12 @@ import * as React from 'react'; | ||
const result = await onSubmit(formData); | ||
if (result) { | ||
this.updateRemoteErrors(result); | ||
const errors = await onSubmit(formData); | ||
if (!mounted) { | ||
return; | ||
} | ||
if (errors) { | ||
this.updateRemoteErrors(errors); | ||
} | ||
this.setState({submitting: false}); | ||
@@ -176,0 +181,0 @@ } |
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
136923
2846