{"_id":"@4react/forms","_rev":"4-adcff814d4baf3727a4c0564b7b5c66d","name":"@4react/forms","dist-tags":{"latest":"2020.1.3"},"versions":{"2020.1.0":{"name":"@4react/forms","version":"2020.1.0","author":{"name":"Matteo Zanoncello"},"license":"ISC","main":"lib/forms.js","module":"lib/forms.module.js","types":"lib/types","scripts":{"clean":"rimraf lib","rollup":"rollup -c","build":"npm run clean && npm run rollup","story":"start-storybook -p 9009 -s .storybook/public","prepublish":"npm run build"},"dependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"peerDependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"devDependencies":{"@4react/eslint-config":"^2020.1.3","@babel/polyfill":"latest","@babel/preset-env":"^7.7.1","@babel/preset-react":"^7.7.0","@babel/preset-typescript":"^7.7.0","@storybook/addon-actions":"^5.3.17","@storybook/addon-knobs":"^5.3.17","@storybook/addon-viewport":"^5.3.17","@storybook/preset-typescript":"^1.2.0","@storybook/react":"^5.3.17","@types/lodash":"^4.14.149","@typescript-eslint/parser":"^2.26.0","babel-loader":"^8.0.6","eslint":"^6.6.0","react-docgen-typescript-loader":"^3.6.0","rimraf":"^3.0.0","rollup":"^1.26.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^2.0.3","rollup-plugin-typescript2":"^0.25.2","styled-components":"^5.1.0","ts-loader":"^6.2.1","typescript":"^3.7.5"},"gitHead":"cf47544ec843cc8162c429015d015c11613d542b","description":"Ready-to-use form context and validation for React Applications.","_id":"@4react/forms@2020.1.0","_npmVersion":"6.2.0","_nodeVersion":"10.15.3","_npmUser":{"name":"matteozanoncello","email":"zanomate@gmail.com"},"dist":{"integrity":"sha512-cHZMDK1FKMNMrp+3axdeuLGVKk7upJRdSleV1UQRPUiueVNQvKuFAXcIRF/QR6bj+c5PKzZnhuOe5W7cobhB2Q==","shasum":"d87b8d3ce67b8d52c859b3e90f750d10723ea849","tarball":"https://registry.npmjs.org/@4react/forms/-/forms-2020.1.0.tgz","fileCount":14,"unpackedSize":26618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqve2CRA9TVsSAnZWagAAmTcP/1sV5yMZeoZatBAaCDD5\nYVxxLGZDcAMqdzKsipq52s0j3GouSARz6a14DE8ugc8n7AmT5pO8HBCXjMEU\n4cfX03ykMLRUCZWLQJKgWvIDY+l9HrPR1z+JAGsmY9XEe7HGRVuXLg0+R7X4\nZZDQ3DwGa+AIkp7/YAb3S6vtx57hJay9efI6Pfg6UH60cx8Z66/YnoaPbkit\nMdJB6ZEat70OIjXsaFUUpDQGTQqYkmDeNWXEBHyccz+J8WnYaWMgqqM8ptrJ\nFrKN5yDW5AormwwxpUwcppbdlk1w1Fa3V8RAahHLw2qUWweE4BIrNu3DjBxP\nfT4w2vcbylNir9n2vI3A14WcFPpYjgxK6UQDJu/km3xfLWCD0JGjNKnrpCIu\njSmVbLmH941WqNr5jGWiCfMSWFoH9PqOKksc0coix8npkBQP+nk9bwlGipzs\nrVJYC7tjBEImzlh+69uePpbf1598SqEGlxaB0bZCGeoU5NQ8VjUvoi10TCB5\nS2NCmQOM33PfyXnsl5mS8lLf87bCTlxAqnyCIXxLsHD9CEl70wAmvLfbYF4/\nuq2G/rjA511tZHWIglfeYpkiwTWyQXn9t6qvXtWH6s7be48q3SNVfyvBAZhd\n9lAeQLGkDmKfbqEtDJGnWZTOyoAjMU9N2l/UCqeY72fuBF1mV+am6AgAwOdp\nM+zb\r\n=wOAO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6ARH+BzEUlkkw35pcydysHaBeJlBCGrb/auk/bGrN7AiBRzje1F1UAvoRgs/qPOZaG8hKEDuUNdaoeFMWMbEgmYA=="}]},"maintainers":[{"name":"matteozanoncello","email":"zanomate@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forms_2020.1.0_1588262838092_0.7500174731853155"},"_hasShrinkwrap":false},"2020.1.1":{"name":"@4react/forms","version":"2020.1.1","author":{"name":"Matteo Zanoncello"},"license":"ISC","main":"lib/forms.js","module":"lib/forms.module.js","types":"lib/types","scripts":{"clean":"rimraf lib","rollup":"rollup -c","build":"npm run clean && npm run rollup","story":"start-storybook -p 9009 -s .storybook/public","prepublish":"npm run build"},"dependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"peerDependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"devDependencies":{"@4react/eslint-config":"^2020.1.3","@babel/polyfill":"latest","@babel/preset-env":"^7.7.1","@babel/preset-react":"^7.7.0","@babel/preset-typescript":"^7.7.0","@storybook/addon-actions":"^5.3.17","@storybook/addon-knobs":"^5.3.17","@storybook/addon-viewport":"^5.3.17","@storybook/preset-typescript":"^1.2.0","@storybook/react":"^5.3.17","@types/lodash":"^4.14.149","@typescript-eslint/parser":"^2.26.0","babel-loader":"^8.0.6","eslint":"^6.6.0","react-docgen-typescript-loader":"^3.6.0","rimraf":"^3.0.0","rollup":"^1.26.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^2.0.3","rollup-plugin-typescript2":"^0.25.2","styled-components":"^5.1.0","ts-loader":"^6.2.1","typescript":"^3.7.5"},"gitHead":"f7b7a5f40513f18ab157e3d8c74818facbd51124","description":"Ready-to-use form context and validation for React Applications.","_id":"@4react/forms@2020.1.1","_npmVersion":"6.2.0","_nodeVersion":"10.15.3","_npmUser":{"name":"matteozanoncello","email":"zanomate@gmail.com"},"dist":{"integrity":"sha512-7gtIXJpfSggV0oLMjiRX9nxVq6miEH8XYc0gp4z2Y1MebYulGqt6z5LeTM9XpAM56pFzMSoaMigrBtuaeshSRA==","shasum":"c1d01995e130abcad16e604c7e81629d6e46e5b6","tarball":"https://registry.npmjs.org/@4react/forms/-/forms-2020.1.1.tgz","fileCount":14,"unpackedSize":26672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqyErCRA9TVsSAnZWagAAAwwP/R2g5AAm1TQqivqVCwcV\nFfOOwQslzH3gs7j6hrEE7I2pP/+oJy6OmExR2YmWiEPF35VCfMrRkD2fMx0c\nRQ67YEK+p1trSCLsRAOEPmhkRoytKR6j3orl21nXSkNuIlb5LgWUWjL3h9jL\n3PYn1rrZ8BpO1Gomp8Zltl+rsCE8bPk9CldZ5jhjEOaywszUjwdmTYZ29M5k\ntUiwtqMBDsKvGFsX0Di2EbgJqHJasEtvCIPYgw80hO6NKTYzmjnC0iBTVx7B\nBL2EJkQY2r7sDujkI7nmDvZI0LijeNA6cCnNCSl1AhbfP71n71x435f5lmQ5\nJ7XgKGYDrGcg65jtz4ClQ9x95+ND+Rp+FZnFirmnPVGFPE91Cv3n3ioWbq3R\nRdGFz9iVIdcoLVrkFdU7eG6GtZRRA7KxVrybHjjEyAgyTfmuFz7zuPo9jjh8\n80IBPJyeFiO/sqeJ9QQokeeHwfqwbCujRFzu0YxofAXsuKGpN/xAxGKEnIem\nWbbc/KuFVU9csB8XsCGAnkL4v47FBxvY9zuwiMWyG6v+iIdX3chHGZL5yiXP\nUQrSOJi0BUM8oFL+96leToX9kzbjzFpVThivnVAGZpjTsp98BajB6b/+myiS\n1Cc9JBkoHy01FmC7BCDHmdemHcD+yLNfpo+SbGlbm0GBRnUTOxd1z1zfMBDm\nHo7k\r\n=gIwN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqetJGhXGvlOuTZqHsWqE17eE2nKjRz2BfOt9jcw3s7wIgBZ0lLb5KWPBAMFkL2Dzdln80Ras+0GcvCZlUlhN+JLU="}]},"maintainers":[{"name":"matteozanoncello","email":"zanomate@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forms_2020.1.1_1588273449108_0.21234984976013194"},"_hasShrinkwrap":false},"2020.1.2":{"name":"@4react/forms","version":"2020.1.2","author":{"name":"Matteo Zanoncello"},"license":"ISC","repository":{"url":"git+https://github.com/4react/forms.git"},"main":"lib/forms.js","module":"lib/forms.module.js","types":"lib/types","scripts":{"clean":"rimraf lib","rollup":"rollup -c","build":"npm run clean && npm run rollup","story":"start-storybook -p 9009 -s .storybook/public","prepublish":"npm run build"},"dependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"peerDependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.2","react":"^16.10.2"},"devDependencies":{"@4react/eslint-config":"^2020.1.3","@babel/polyfill":"latest","@babel/preset-env":"^7.7.1","@babel/preset-react":"^7.7.0","@babel/preset-typescript":"^7.7.0","@storybook/addon-actions":"^5.3.17","@storybook/addon-knobs":"^5.3.17","@storybook/addon-viewport":"^5.3.17","@storybook/preset-typescript":"^1.2.0","@storybook/react":"^5.3.17","@types/lodash":"^4.14.149","@typescript-eslint/parser":"^2.26.0","babel-loader":"^8.0.6","eslint":"^6.6.0","react-docgen-typescript-loader":"^3.6.0","rimraf":"^3.0.0","rollup":"^1.26.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^2.0.3","rollup-plugin-typescript2":"^0.25.2","styled-components":"^5.1.0","ts-loader":"^6.2.1","typescript":"^3.7.5"},"gitHead":"a74ace4de94255b1341e744ddc07c20b27b5b41f","description":"Ready-to-use form context and validation for React Applications.","bugs":{"url":"https://github.com/4react/forms/issues"},"homepage":"https://github.com/4react/forms#readme","_id":"@4react/forms@2020.1.2","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iscHl0gq2vZW6nF5/PcoXzCrZWjSnhgS6CAcrFfP0ljyWApaBH81o7/tW6royljAO5vFcB6BfQZDuULByhWrzw==","shasum":"1f2622b38ced4f5b45802639d0d5839255d4471f","tarball":"https://registry.npmjs.org/@4react/forms/-/forms-2020.1.2.tgz","fileCount":14,"unpackedSize":26906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesBalCRA9TVsSAnZWagAAvD0QAIQy8y3cB0/+TWWIw51g\nTEbWXh8sWQWwxHKitzFHOwXGHc3cddGmeoai/y5NfZbexWW4bV9ruvBH8fCN\nP3Ru3oTYZySeQH0asEMQ4h5qVJ+l9ibOnNXWXgZyXun/ZzjoQ68J0t8huFEf\nrhRGFJHKgFnybD4GiWta4Q0ZGEhBwONVdq2JAAMmcq7QtPCvAhH+wsH2hpSQ\naCcfKv2yLz/fghwYjowY02lVsRZuhq6LN+XRTD3WKZoDUjQPrYHRQM1dXjjW\na1Tz65bcRv5ipxJlxJKgpbikIqMblHuxs1aE+eXd6CAKFwRypECtk/Nz+s3+\nMrKvkzfYrUvqzhpdb5cTnFtVmcRkcT/Pad77DizYIMeN6eeMHzfnp2EqCB+n\nBlra+ajugmA6awx4BAJ+4ye8Fn1SHFCp1R7mmGbZYBnQNshrhO4p32sfcbl/\nICTOOtjQQquO1JLydJKWQK06mUs2OEnX42o0bbcGUq1UmFe1ZpX7h3/S0+hT\nFllAQ3sF6SBIOwQouX2l1XK59FmbaAoLTI8B/m06KPPx5nrBPvX5oelHMm/9\nFphiqKc+X+5/9hXIeaYopk8KgObaNCBuJB79Fu/K5LwvjoPDFmbZnuWJFdt3\n2qL1tT2+EaNfSYA3AUJc6AUyGheSTvDwHPWeIPELLtRyP0y5u8hySJS2RgEe\nCuJ8\r\n=/+pL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY8hnlHAZLEv3q5rhYUKxsbB+Xi+Ty+1btfmrokKhgbgIhAPcRrLT5iUa/bBKMo2FQok8+JrTlk8LrVVBIdn7+gjRW"}]},"maintainers":[{"name":"matteozanoncello","email":"zanomate@gmail.com"}],"_npmUser":{"name":"matteozanoncello","email":"zanomate@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forms_2020.1.2_1588598437141_0.1442694723094049"},"_hasShrinkwrap":false},"2020.1.3":{"name":"@4react/forms","version":"2020.1.3","author":{"name":"Matteo Zanoncello"},"license":"ISC","repository":{"url":"git+https://github.com/4react/forms.git"},"main":"lib/forms.js","module":"lib/forms.module.js","types":"lib/types","scripts":{"clean":"rimraf lib","rollup":"rollup -c","build":"npm run clean && npm run rollup","story":"start-storybook -p 9009 -s .storybook/public","prepublish":"npm run build"},"dependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.3","react":"^16.10.2"},"peerDependencies":{"@4react/hooks":"^2020.1.7","@4react/store":"^2020.1.3","react":"^16.10.2"},"devDependencies":{"@4react/eslint-config":"^2020.1.3","@babel/polyfill":"latest","@babel/preset-env":"^7.7.1","@babel/preset-react":"^7.7.0","@babel/preset-typescript":"^7.7.0","@storybook/addon-actions":"^5.3.17","@storybook/addon-knobs":"^5.3.17","@storybook/addon-viewport":"^5.3.17","@storybook/preset-typescript":"^1.2.0","@storybook/react":"^5.3.17","@types/lodash":"^4.14.149","@typescript-eslint/parser":"^2.26.0","babel-loader":"^8.0.6","eslint":"^6.6.0","react-docgen-typescript-loader":"^3.6.0","rimraf":"^3.0.0","rollup":"^1.26.3","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-postcss":"^2.0.3","rollup-plugin-typescript2":"^0.25.2","styled-components":"^5.1.0","ts-loader":"^6.2.1","typescript":"^3.7.5"},"gitHead":"7670df2c360ef21bf815ebda91439bf75e7afd1d","description":"Ready-to-use form context and validation for React Applications.","bugs":{"url":"https://github.com/4react/forms/issues"},"homepage":"https://github.com/4react/forms#readme","_id":"@4react/forms@2020.1.3","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-gjzs+rDzPAXGofWeYzkgzrWZIqkDUW2nQBqyAvQwLGgdSi30gqYNu4yBPB0zom/zpqH/dZ/ScABW5LzYrqYvew==","shasum":"de79a23e9f7ef07e3148efdf0599477ea6dee794","tarball":"https://registry.npmjs.org/@4react/forms/-/forms-2020.1.3.tgz","fileCount":14,"unpackedSize":27606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesEDpCRA9TVsSAnZWagAAdY8QAJbNK517V2PD8NjiWdEK\n+k2xyTUsminr4KMLMptBIbxA8FX41vLG0qy8+io0LVdKmx1jAxqWT70z5b12\nqQIQGzSoRBrZc3bR/EGgBLgkkwps4j8oPSwZf+B+Wzfl5Ta8cqlmc7K09CUz\nxdzRYGppCOpyP+r8Kpefe2tsNJAFfRSgisku3xTivSeIOjpBtaQkz8Wflkcz\nMAsrRi34GHB1t8Ogx3mdoM7WeWjjrv3QohUr5VaPmKJwpBZz0miz3Vv2Gj3u\nZGi07CSvczUAxTCk9ivnh8cUTRl/bJrWkDpLZ/FmvK8UwgMpcidi0c6p/Ig8\na30FakAuHDkZZxR+9raShJgDjmi70K811EPVlm6N9ng/Og9uJpFsvXgwBTQk\noWoo8JRzTz8A+bhFgWRH5Oj8dIAXZtsNzyrmy1nazTEwCedenqN1zWgbtA+V\neirAy6ybNnNlxMeQRLDoDeyxdzr52DWFFZk6nydc8WgOdTxIbM19WWv2p4py\nSTUzbMOfMNvY24DMDrTsJ+h0moRPCB5DjJtAd5Pq7byHJPKz5p6NSq2g6bU2\nQAK3b6lwLTp2JpznjPPiG60lEBIoN0bidKD1ZXN8ALDfw9KKk2hoabguCOE/\nKv2jdajaKUM9uAoulXBNAoLsaIzMX4AFdgFtSwcnoAYok9ubARAyRs0XvsZV\n3fOZ\r\n=MkqT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCctx8+cgBiM20pgJIYRBlRdn2bpQnmT0vnn88HkONH2gIgHzYGOUNeyjm76wWE13V+Z8JSSe0/Tjc56K489yvd9Gc="}]},"maintainers":[{"name":"matteozanoncello","email":"zanomate@gmail.com"}],"_npmUser":{"name":"matteozanoncello","email":"zanomate@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forms_2020.1.3_1588609257446_0.014696109087950715"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-30T16:07:17.822Z","2020.1.0":"2020-04-30T16:07:18.253Z","modified":"2022-04-04T10:47:21.197Z","2020.1.1":"2020-04-30T19:04:09.220Z","2020.1.2":"2020-05-04T13:20:37.234Z","2020.1.3":"2020-05-04T16:20:57.615Z"},"maintainers":[{"name":"matteozanoncello","email":"zanomate@gmail.com"}],"description":"Ready-to-use form context and validation for React Applications.","author":{"name":"Matteo Zanoncello"},"license":"ISC","readme":"# @4react / forms\r\n\r\nReady-to-use form context and validation for React Applications.\r\n\r\n## Usage\r\n\r\n### Import dependency\r\n\r\n```\r\nnpm i @4react/forms\r\n```\r\n\r\n### Compose fields\r\n\r\n```jsx\r\nimport { Form, FormField, FormData } from '@4react/forms'\r\n\r\nconst App = () => (\r\n  <Form>\r\n    <FormField name=\"username\" accept={/^\\w+$/}>\r\n      {({ update, valid }) => <input ... />}\r\n    </FormField>\r\n    <FormField name=\"password\">\r\n      {({ update, valid }) => <input ... />}\r\n    </FormField>\r\n    <FormData>\r\n      {({ values, valid }) => <button ... />}\r\n    </FormData>\r\n  </Form>\r\n)\r\n```\r\n\r\n[Live example](https://codesandbox.io/s/4reactformssample1-vlxbo?file=/src/App.js)\r\n\r\n## API\r\n\r\n### Form\r\nComponent that provides a context for a form.\r\n\r\n```jsx\r\nimport { Form } from '@4react/forms'\r\n\r\nconst App = () => (\r\n  <Form>\r\n    ...\r\n  </Form>\r\n)\r\n```\r\n\r\n| Name | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| initialValues | object | - | ***optional*** - Initial values for the form fields. |\r\n\r\n### FormField\r\nComponent that registers a new field for the surrounding form.\r\n\r\n```jsx\r\nimport { FormField } from '@4react/forms'\r\n\r\n...\r\n\r\n<FormField name=\"email\">\r\n  {({ update, valid }) => (\r\n    <input\r\n      type=\"text\"\r\n      onChange={e => update(e.target.value)}\r\n      style={{ borderColor: valid ? 'gray' : 'red' }}\r\n    />\r\n  )}\r\n</FormField>\r\n```\r\n\r\n| Name | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| name | string | - | Name of the field |\r\n| defaultValue | any | - | ***optional*** - Default value of the field. |\r\n| accept | Function, RegExp | - | ***optional*** - If provided, this function is used to validate the value of the field. For string fields (and compatible types fields) a RegExp can be use also. |\r\n| validateOn | \"init\", \"update\" | \"update\" | ***optional*** - Use to control which moments are take into consideration for validation. A list of values is also accepted. |\r\n\r\nThis components accept a child function, and provides to it an object with the following properties:\r\n\r\n| Name | Type | Description |\r\n| --- | --- | --- |\r\n| update | Function | Required to update the value of the field. |\r\n| valid | boolean | Points if last validation is passed or none is executed yet.\r\n| value | any | The stored value of the field (for controlled inputs). |\r\n\r\n### FormData\r\nComponent that retrieves all values of the current form.\r\n\r\n```jsx\r\nimport { FormData } from '@4react/forms'\r\n\r\n...\r\n    \r\n<FormData>\r\n  {({ values, valid }) => (\r\n    <button\r\n      disabled={!valid}\r\n      onClick={() => sendData(values)}\r\n    >\r\n      SEND DATA\r\n    </button>\r\n  )}\r\n</FormData>\r\n```\r\n\r\n| Name | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| validate | boolean | true | ***optional*** - Used for performance issues, setting this property to false will disable automatic validation. Manual validation can be triggered by calling the `validate` method passed to children. |\r\n\r\nThis components accept a child function, and provides to it the following properties:\r\n\r\n| Name | Type | Description |\r\n| --- | --- | --- |\r\n| values | object | Object containing all values of the form. |\r\n| valid | boolean | Points if the values in all the fields are considered valid. Returns false if no validation is done yet.\r\n| validate | Function | For performance reasons it's possible to force validation only on demand. In these cases invoking this function will validate the entire form. |\r\n\r\n### Hooks\r\nAlternatively to the use of the above components, it's possible to create custom fields and data consumers, using the following hooks:\r\n\r\n#### useFormField\r\nThis hook will register a new field with the specified name, and returns the same set of properties of the `FormField` component (see [FormField](#formfield)). \r\n\r\n```jsx\r\nimport { useFormField } form '@4react/forms'\r\n\r\nconst MyCustomField = ({ name }) => {\r\n  const { update, valid } = useFormField(name)\r\n\r\n  return <input ... />\r\n}\r\n```\r\n\r\n| Name | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| name | string | - | Name of the field. |\r\n| options | object | {} | ***optional*** - Object accepting all optional props of the `FormField` component (see [FormField](#formfield)). |\r\n\r\n### useFormData\r\nThis hook retrieves collected values of the current form, and returns the same set of properties of the `FormData` component (see [FormData](#formdata)).\r\n\r\n```jsx\r\nimport { useFormData } from '@4react/forms'\r\n\r\nconst MyCustomSubmit = () => {\r\n  const { values, valid } = useFormData()\r\n\r\n  return <button ... />\r\n}\r\n```\r\n\r\n| Name | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| options | object | {} | ***optional*** - Object accepting all optional props of the `FormData` component (see [FormData](#formdata)). |\r\n","readmeFilename":"README.md","homepage":"https://github.com/4react/forms#readme","repository":{"url":"git+https://github.com/4react/forms.git"},"bugs":{"url":"https://github.com/4react/forms/issues"}}