{"id":30900637,"url":"https://github.com/hjyup/use-react-hook-form-persist","last_synced_at":"2026-05-07T04:40:39.717Z","repository":{"id":313635156,"uuid":"1051808381","full_name":"HJyup/use-react-hook-form-persist","owner":"HJyup","description":"Lightweight persistence for react-hook-form with nested field support.","archived":false,"fork":false,"pushed_at":"2025-09-07T09:40:40.000Z","size":80,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-07T14:27:02.578Z","etag":null,"topics":["library","npm-package","persistence","react","react-hook-form","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HJyup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T19:02:39.000Z","updated_at":"2025-09-07T09:40:08.000Z","dependencies_parsed_at":"2025-09-07T14:27:08.885Z","dependency_job_id":"1a0c0fc3-ea53-434c-a2c4-b416caf61cef","html_url":"https://github.com/HJyup/use-react-hook-form-persist","commit_stats":null,"previous_names":["hjyup/use-react-hook-form-persist"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HJyup/use-react-hook-form-persist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fuse-react-hook-form-persist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fuse-react-hook-form-persist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fuse-react-hook-form-persist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fuse-react-hook-form-persist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HJyup","download_url":"https://codeload.github.com/HJyup/use-react-hook-form-persist/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HJyup%2Fuse-react-hook-form-persist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274250508,"owners_count":25249396,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["library","npm-package","persistence","react","react-hook-form","typescript"],"created_at":"2025-09-09T05:53:22.926Z","updated_at":"2026-05-07T04:40:39.681Z","avatar_url":"https://github.com/HJyup.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-react-hook-form-persist\n\nA lightweight hook for persisting form state in `react-hook-form`, with support for nested fields, custom storage, and full control.\n\n## 🚀 Usage\n\nA small example how you can use this hook:\n\n```javascript\nimport { useForm } from \"react-hook-form\";\nimport { useFormPersist } from \"use-react-hook-form-persist\";\n\ntype FormValues = {\n  name: string,\n  email: string,\n  password: string\n};\n\nexport function ProfileForm() {\n  const form =\n    useForm \u003c\n    FormValues \u003e\n    {\n      defaultValues: {\n        name: \"John Doe\",\n        email: \"john.doe@example.com\",\n        password: \"\"\n      }\n    };\n\n  const persistedForm = useFormPersist(form, {\n    key: \"form-data\"\n  });\n\n  const { register, handleSubmit } = persistedForm;\n\n  return (\n    \u003cform onSubmit={handleSubmit((values) =\u003e console.log(values))}\u003e\n      \u003cinput {...register(\"name\")} placeholder=\"Name\" /\u003e\n      \u003cinput {...register(\"email\")} placeholder=\"Email\" /\u003e\n      \u003cinput {...register(\"password\")} type=\"password\" placeholder=\"Password\" /\u003e\n      \u003cbutton type=\"submit\"\u003eSave\u003c/button\u003e\n    \u003c/form\u003e\n  );\n}\n```\n\n## 📦 Installation\n\nUsing your preferred package manager:\n\n```bash\n    # with pnpm\n    pnpm add use-react-hook-form-persist\n\n    # or with npm\n    npm install use-react-hook-form-persist\n\n    # or with yarn\n    yarn add use-react-hook-form-persist\n```\n\n## ✨ Features\n\n- Full control over storage (localStorage, sessionStorage, or custom) and serialisation parser.\n- Works seamlessly with deeply nested form values, arrays, and objects.\n- Include or exclude specific fields and paths with fine-grained control.\n- Handle schema changes gracefully with version numbers and optional mismatch callbacks.\n- Powered by TypeScript and react-hook-form’s path types for strong guarantees.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjyup%2Fuse-react-hook-form-persist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhjyup%2Fuse-react-hook-form-persist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhjyup%2Fuse-react-hook-form-persist/lists"}