{"id":14977643,"url":"https://github.com/insin/react-router-form","last_synced_at":"2025-09-21T00:31:24.668Z","repository":{"id":27080301,"uuid":"30546960","full_name":"insin/react-router-form","owner":"insin","description":"\u003cForm\u003e is to \u003cform\u003e as \u003cLink\u003e is to \u003ca\u003e","archived":false,"fork":false,"pushed_at":"2018-02-01T22:51:31.000Z","size":54,"stargazers_count":56,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-04T23:24:03.250Z","etag":null,"topics":["experiment","forms","react","react-component","react-router"],"latest_commit_sha":null,"homepage":"http://insin.github.io/react-router-form/","language":"JavaScript","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/insin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-09T17:00:10.000Z","updated_at":"2020-05-29T07:37:56.000Z","dependencies_parsed_at":"2022-09-12T06:30:29.536Z","dependency_job_id":null,"html_url":"https://github.com/insin/react-router-form","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/insin/react-router-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Freact-router-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Freact-router-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Freact-router-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Freact-router-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/insin","download_url":"https://codeload.github.com/insin/react-router-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/insin%2Freact-router-form/sbom","scorecard":{"id":489732,"data":{"date":"2025-08-11","repo":{"name":"github.com/insin/react-router-form","commit":"1de409947704eea116b97f924a4d9c16932393d3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":"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":"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":"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":"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"}},{"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: MIT License: 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"}}]},"last_synced_at":"2025-08-19T18:45:49.384Z","repository_id":27080301,"created_at":"2025-08-19T18:45:49.384Z","updated_at":"2025-08-19T18:45:49.384Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276179282,"owners_count":25598565,"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-20T02:00:10.207Z","response_time":63,"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":["experiment","forms","react","react-component","react-router"],"created_at":"2024-09-24T13:56:04.262Z","updated_at":"2025-09-21T00:31:24.421Z","avatar_url":"https://github.com/insin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## React Router `\u003cForm\u003e`\n\n[![Travis][build-badge]][build]\n[![npm package][npm-badge]][npm]\n[![Coveralls][coveralls-badge]][coveralls]\n\nA `\u003cForm\u003e` component for use with [React Router](https://github.com/rackt/react-router) which does for `\u003cform\u003e` what react-router's `\u003cLink\u003e` does for `\u003ca\u003e`.\n\n## Usage\n\nA `\u003cForm\u003e` component renders a `\u003cform\u003e` element with the contents you provide, hooks into the form's `onSubmit` event to extract user input and transitions to the configured route with user input data in the next location's state.\n\n```js\nimport React from 'react'\nimport Form from 'react-router-form'\n\nlet NewPost = React.createClass({\n  render() {\n    \u003cForm to={`/topics/${this.props.params.topicId}/add-post`} method=\"POST\"\u003e\n      \u003ctextarea name=\"comment\"/\u003e\n      \u003cbutton type=\"submit\"\u003eAdd Post\u003c/button\u003e\n    \u003c/Form\u003e\n  }\n})\n```\nFor example, assuming you have the following routes, the component above would trigger the `onEnter` handler for the `add-post` route when the form is submitted:\n\n```js\n\u003cRoute path=\"/topics/:topicId/new-post\" component={NewPost}/\u003e\n\u003cRoute path=\"/topics/:topicId/add-post\" onEnter={handleAddPost}/\u003e\n```\n\nForm data is set as a `body` property and the form's `method` is set as a `method` property in the next location's state:\n\n```js\nfunction handleAddPost(nextState, replaceState) {\n  console.log(nextState.location.state.method) // 'POST'\n  console.log(nextState.location.state.body) // {comment: '...'}\n}\n```\n\n## Goals\n\nOne of the key goals of this component is to make it easier to implement basic isomorphic forms in your React app.\n\nIf your `onEnter` handlers send back everything needed to re-render a form which has errors (i.e. validation errors *and* user input), then for a little extra effort your React components can handle form submissions on both client and server:\n\n```js\nfunction handleAddPost(nextState, replace, callback) {\n  let comment = nextState.location.state.body\n  let {topicId} = nextState.params\n  ForumService.addComment({comment, topicId})\n    .then(({page}) =\u003e {\n      replace(`/topics/${topicId}?page=${page}`)\n    })\n    .catch(errors =\u003e {\n      replace({\n        pathname: `/topics/${topicId}/new-post`,\n        state: {comment, errors}.\n      })\n    })\n    .finally(callback)\n}\n```\n\n## Install\n\n```sh\n# For React Router 3.x\nnpm install react-router-form\n\n# For React Router 1.x\nnpm install react-router-form@1\n```\n\n```js\nimport Form from 'react-router-form'\n// or\nconst Form = require('react-router-form')\n```\n\nBrowser bundles are available, which export a global `ReactRouterForm` variable and expect to find a global ``React`` variable to work with.\n\n* [react-router-form.js](https://unpkg.com/react-router-form/umd/react-router-form.js) (development version)\n* [react-router-form.min.js](https://unpkg.com/react-router-form/umd/react-router-form.min.js) (compressed production version)\n\n## MIT Licensed\n\n[build-badge]: https://img.shields.io/travis/insin/react-router-form/master.png?style=flat-square\n[build]: https://travis-ci.org/insin/react-router-form\n\n[npm-badge]: https://img.shields.io/npm/v/react-router-form.png?style=flat-square\n[npm]: https://www.npmjs.org/package/react-router-form\n\n[coveralls-badge]: https://img.shields.io/coveralls/insin/react-router-form/master.png?style=flat-square\n[coveralls]: https://coveralls.io/github/insin/react-router-form\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Freact-router-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsin%2Freact-router-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsin%2Freact-router-form/lists"}