{"id":16130762,"url":"https://github.com/ilxanlar/react-hooks-form","last_synced_at":"2025-03-16T09:32:36.599Z","repository":{"id":33981287,"uuid":"165263303","full_name":"ilxanlar/react-hooks-form","owner":"ilxanlar","description":"React Forms the Hooks Way","archived":false,"fork":false,"pushed_at":"2022-12-10T02:39:16.000Z","size":2586,"stargazers_count":27,"open_issues_count":17,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-10T22:17:31.419Z","etag":null,"topics":["form","hooks","react","react-hooks-form"],"latest_commit_sha":null,"homepage":"https://ilxanlar.github.io/react-hooks-form/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilxanlar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-11T15:12:57.000Z","updated_at":"2024-07-22T14:50:56.000Z","dependencies_parsed_at":"2023-01-15T04:01:15.824Z","dependency_job_id":null,"html_url":"https://github.com/ilxanlar/react-hooks-form","commit_stats":null,"previous_names":["ilxanlar/hooks-form"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilxanlar%2Freact-hooks-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilxanlar%2Freact-hooks-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilxanlar%2Freact-hooks-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilxanlar%2Freact-hooks-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilxanlar","download_url":"https://codeload.github.com/ilxanlar/react-hooks-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221661521,"owners_count":16859536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["form","hooks","react","react-hooks-form"],"created_at":"2024-10-09T22:17:38.479Z","updated_at":"2024-10-27T10:18:15.106Z","avatar_url":"https://github.com/ilxanlar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Hooks Form\n\nReact Hooks Form offers an easy way to manage your forms in React.\nIt's built using the famous React Hooks!\n\n\n### Documentation\n\nYou can find the complete documentation [here](https://ilxanlar.github.io/react-hooks-form).\n\n\n### Usage\n\nInstall via NPM or Yarn:\n\n```\nnpm install react-hooks-form --save\nyarn add react-hooks-form\n```\n\n\nThe following code snippet is a basic example of using React Hooks Form.\n\n```jsx harmony\nimport React from 'react'\nimport { Form, FormField } from 'react-hooks-form'\n\nasync function handleSubmit(values) {\n  try {\n    await _myApiRequest(values)\n  } catch (error) {\n    alert(error.message)\n  }\n}\n\nfunction SignUpForm() {\n  return (\n    \u003cForm onSubmit={handleSubmit}\u003e\n      \u003cFormField component=\"input\" name=\"fullName\" type=\"text\" /\u003e\n      \u003cFormField component=\"input\" name=\"email\" type=\"text\" /\u003e\n      \u003cFormField component=\"input\" name=\"password\" type=\"password\" /\u003e\n      \u003cbutton type=\"submit\"\u003eSign Up\u003c/button\u003e\n    \u003c/Form\u003e\n  )\n}\n```\n\n\n### Hooks\n\n```js\n// Hook to field value\nconst amount = useFormFieldValue('amount')\n\n// Hook to field error, focus status and ...\nconst {\n  active,\n  error,\n  invalid,\n  visited\n} = useFormFieldMeta('amount')\n\n// Hook to get form all values\nconst values = useFormValues()\n\n// Hook to form submission status, errors and ...\nconst {\n  submitting,\n  submitFailed,\n  submitSucceeded,\n  error\n} = useFormMeta()\n\n// Hook to access form API\nconst formApi = useForm() // There are plenty of methods\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filxanlar%2Freact-hooks-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filxanlar%2Freact-hooks-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filxanlar%2Freact-hooks-form/lists"}