{"id":21291892,"url":"https://github.com/idea2app/react-router-class-tools","last_synced_at":"2025-07-11T16:30:53.498Z","repository":{"id":57688797,"uuid":"481578326","full_name":"idea2app/React-Router-class-tools","owner":"idea2app","description":"Class Component utilities for React Router 6+, which rolls back the Class supports dropped by official team.","archived":false,"fork":false,"pushed_at":"2023-06-03T07:24:49.000Z","size":86,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-31T17:15:47.641Z","etag":null,"topics":["class","component","react","router","tool","utility"],"latest_commit_sha":null,"homepage":"http://ideapp.dev/React-Router-class-tools/","language":"TypeScript","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/idea2app.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":"2022-04-14T11:27:31.000Z","updated_at":"2023-06-03T07:26:18.000Z","dependencies_parsed_at":"2022-08-25T15:41:49.631Z","dependency_job_id":null,"html_url":"https://github.com/idea2app/React-Router-class-tools","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FReact-Router-class-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FReact-Router-class-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FReact-Router-class-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idea2app%2FReact-Router-class-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idea2app","download_url":"https://codeload.github.com/idea2app/React-Router-class-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225741249,"owners_count":17516894,"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":["class","component","react","router","tool","utility"],"created_at":"2024-11-21T13:46:37.968Z","updated_at":"2024-11-21T13:46:38.667Z","avatar_url":"https://github.com/idea2app.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Router class tools\n\n**Class Component** utilities for [React Router][1] 6+\n\n[![CI \u0026 CD](https://github.com/idea2app/React-Router-class-tools/actions/workflows/main.yml/badge.svg)][2]\n\n[![NPM](https://nodei.co/npm/react-router-class-tools.png?downloads=true\u0026downloadRank=true\u0026stars=true)][3]\n\n[![Demo](https://codesandbox.io/static/img/play-codesandbox.svg)][4]\n\n## Feature\n\n-   [x] `withRouter()` function\n-   [ ] `withRouter()` decorator\n-   [x] `RouteComponentProps`\n-   [ ] `this.props.history`\n-   [x] `this.props.location`\n-   [x] `this.props.match`\n-   [ ] Static Context\n-   [x] `this.props.query`: the missing **Query object**\n\n## Usage\n\n```tsx\nimport { PureComponent } from 'react';\nimport { RouteComponentProps, withRouter } from 'react-router-class-tools';\n\nexport default withRouter(\n    class RoutePage extends PureComponent\u003c\n        RouteComponentProps\u003c{ id: string }, {}, { extra: number }\u003e\n    \u003e {\n        render() {\n            const { id } = this.props.match.params,\n                { extra } = this.props.query;\n\n            return (\n                \u003cul\u003e\n                    \u003cli\u003eID: {id}\u003c/li\u003e\n                    \u003cli\u003eextra: {extra}\u003c/li\u003e\n                \u003c/ul\u003e\n            );\n        }\n    }\n);\n```\n\n## Reference\n\n1. https://github.com/remix-run/react-router/issues/8146\n2. https://segmentfault.com/a/1190000041700003\n\n## User case\n\n1. https://github.com/idea2app/React-MobX-Bootstrap-ts\n2. https://github.com/idea2app/React-MobX-Ant-Design-ts\n\n[1]: https://reactrouter.com/\n[2]: https://github.com/idea2app/React-Router-class-tools/actions/workflows/main.yml\n[3]: https://nodei.co/npm/react-router-class-tools/\n[4]: https://codesandbox.io/s/react-class-router-1y99mv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidea2app%2Freact-router-class-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidea2app%2Freact-router-class-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidea2app%2Freact-router-class-tools/lists"}