Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/react-form-state

Package Overview
Dependencies
Maintainers
13
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-form-state - npm Package Compare versions

Comparing version 0.10.5 to 0.10.6

20

docs/building-forms.md

@@ -315,2 +315,22 @@ # Building forms with FormState

To run multiple functions on an inner field of a nested field you can use [validateNested](validators.md#validatenested).
```typescript
validators={{
person: validateNested({
age: [
(input) => {
if (input < 16) {
return 'too young';
}
},
(input) => {
if (input > 200) {
return 'too old';
}
},
]
})
```
`<FormState />` generates handlers that follow the [Polaris form validation guidelines](https://polaris.shopify.com/patterns/error-messages#section-form-validation). When you blur an input, or when you change it and it already has an error, any defined validators for that field will be invoked.

@@ -317,0 +337,0 @@

5

docs/validators.md

@@ -212,3 +212,6 @@ # Validators

firstVariant: validateNested({
price: validators.numericString('variant price should be a number'),
price: [
validators.numericString('variant price should be a number'),
nextValidator('message')
],
sku: validators.lengthLessthan(3, 'variant SKU must be shorter than 3 characters');

@@ -215,0 +218,0 @@ });

2

package.json
{
"name": "@shopify/react-form-state",
"version": "0.10.5",
"version": "0.10.6",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Manage react forms tersely and type-safe with no magic.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc