{"id":13450392,"url":"https://github.com/andy9775/react-declare-form","last_synced_at":"2026-05-14T12:35:39.321Z","repository":{"id":57333127,"uuid":"156927301","full_name":"andy9775/react-declare-form","owner":"andy9775","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-18T06:41:28.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T09:07:01.526Z","etag":null,"topics":["form","hooks","react","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andy9775.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}},"created_at":"2018-11-09T22:59:32.000Z","updated_at":"2018-11-18T06:41:30.000Z","dependencies_parsed_at":"2022-08-24T19:01:49.639Z","dependency_job_id":null,"html_url":"https://github.com/andy9775/react-declare-form","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andy9775/react-declare-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy9775%2Freact-declare-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy9775%2Freact-declare-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy9775%2Freact-declare-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy9775%2Freact-declare-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andy9775","download_url":"https://codeload.github.com/andy9775/react-declare-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy9775%2Freact-declare-form/sbom","scorecard":{"id":195027,"data":{"date":"2025-08-11","repo":{"name":"github.com/andy9775/react-declare-form","commit":"2eaff5e0f48b8a03ed628b58848e54a7c3e99fdb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T21:39:35.042Z","repository_id":57333127,"created_at":"2025-08-16T21:39:35.042Z","updated_at":"2025-08-16T21:39:35.042Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278198583,"owners_count":25946777,"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-10-03T02:00:06.070Z","response_time":53,"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":["form","hooks","react","typescript"],"created_at":"2024-07-31T07:00:34.194Z","updated_at":"2025-10-03T17:43:36.257Z","avatar_url":"https://github.com/andy9775.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# react-declare-form\n\nA declarative approach towards building forms in react\n\n## NOTE: This project uses react hooks which are available in alpha.\n\nView the RFC [here](https://github.com/reactjs/rfcs/pull/68)\n\n## About\n\nThe purpose of **react-declare-form** is encapsulate form state management into a\nroot component which wraps children (input, button, select) to allow a\ndeclarative way of building up forms.\n\n**react-declare-form** supports handling of required components by defining a\ncallback function which returns if a form component has been filled out or not.\nIt also supports passing up errors. Both of these objects are available\nthroughout all form components which allows error messages to be displayed\naround buttons and other form components for example.\n\n**react-declare-form** only exports two elements. A root form component `Form`\nwhich should be provided with wrapped components. Components should be wrapped\nusing `connectToForm` function which provides props to the form components to\nbe used in fetching and settings state, errors and required handler logic.\nAnyone familiar with the Redux style connect function will be comfortable with\nthis pattern. This means that buttons, inputs, selects and other form\ncomponents need to be wrapped and built and are **not** provided.\n\n## API\n\n### Form Components\n\nNOTE: Each form component should have a `stateKey` and `initialStateKey` prop\nprovided. Both of these should be unique as they identify that particular\ncomponents state throughout the form.\n\nTODO\n\n## Example\n\n```javascript\nlet Input = props =\u003e (\n  \u003cinput\n    value={props.componentState || ''}\n    onChange={e =\u003e {\n      e.preventDefault();\n      props.setFormState(\n        event.target.value, // state\n        event.target.value // meta\n      );\n    }}\n    type=\"text\"\n  /\u003e\n);\nInput = connectToForm(Input);\n\nlet Button = props =\u003e (\n  \u003cbutton onClick={() =\u003e props.onButtonClick(props.id)}\u003e\n    {this.props.children}\n  \u003c/button\u003e\n);\nButton = connectToForm(Button, { setInitialStateCallback: false });\n\nconst initialState = { email: 'andy@react.com' };\n\nconst myForm = () =\u003e (\n  \u003cForm\n    onButtonClick={formEvent =\u003e {\n      // Submit form\n      api.post(url, formEvent.state.displayState);\n    }}\n    initialState={initialState}\n  \u003e\n    \u003cInput stateKey=\"email\" initialStateKey=\"email\" /\u003e\n    \u003cButton id=\"submit\"\u003eSubmit\u003c/Button\u003e\n  \u003c/Form\u003e\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy9775%2Freact-declare-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandy9775%2Freact-declare-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy9775%2Freact-declare-form/lists"}