{"id":13682721,"url":"https://github.com/Paratron/hookrouter","last_synced_at":"2025-04-30T09:33:56.702Z","repository":{"id":39590248,"uuid":"170408950","full_name":"Paratron/hookrouter","owner":"Paratron","description":"The flexible, and fast router for react that is entirely based on hooks","archived":true,"fork":false,"pushed_at":"2022-09-14T03:13:10.000Z","size":306,"stargazers_count":1506,"open_issues_count":65,"forks_count":92,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-05-17T21:46:10.533Z","etag":null,"topics":["hooks","navigation","queryparams","react","router","ssr","title"],"latest_commit_sha":null,"homepage":"","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/Paratron.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-02-12T23:45:15.000Z","updated_at":"2024-05-02T15:17:15.000Z","dependencies_parsed_at":"2022-09-09T05:40:55.760Z","dependency_job_id":null,"html_url":"https://github.com/Paratron/hookrouter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Fhookrouter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Fhookrouter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Fhookrouter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Fhookrouter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paratron","download_url":"https://codeload.github.com/Paratron/hookrouter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224206196,"owners_count":17273404,"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":["hooks","navigation","queryparams","react","router","ssr","title"],"created_at":"2024-08-02T13:01:51.705Z","updated_at":"2024-11-12T02:31:36.368Z","avatar_url":"https://github.com/Paratron.png","language":"JavaScript","readme":"# React Hook Router\n\nThe modern alternative to react-router.\n\nTested from `React 16.8.1` upwards.\n\n## How to install\nWell, this is straightforward:\n\n    npm i hookrouter\n\n## Typescript\nThis project is not and will not be written in typescript.\n\nThanks to the github user [@mcaneris](https://github.com/mcaneris), you can install types via:\n\n    npm i @types/hookrouter\n    \nI did not check if those types are correct nor will I keep them up to date with future releases. \n    \n    \n## Documentation\nDetailed documentation about how to use hookrouter can be [found here](https://github.com/Paratron/hookrouter/blob/master/src-docs/pages/en/README.md)\n\n## A quick example\n```jsx harmony\nimport {useRoutes} from 'hookrouter';\n\nconst routes = {\n    '/': () =\u003e \u003cHomePage /\u003e,\n    '/about': () =\u003e \u003cAboutPage /\u003e,\n    '/products': () =\u003e \u003cProductOverview /\u003e,\n    '/products/:id': ({id}) =\u003e \u003cProductDetails id={id} /\u003e\n};\n\t\nconst MyApp = () =\u003e {\n    const routeResult = useRoutes(routes);\n    \n    return routeResult || \u003cNotFoundPage /\u003e;\n}\n```\nRoutes are defined as an object. Keys are the routes, which are matched\nagainst the URL, the values need to be functions that are called when a route\nmatches. You may define placeholders in your routes with `:something` which\nwill be forwarded as props to your function calls so you can distribute them\nto your components.\n\nThe hook will return whatever the route function returned, so you may also return\nstrings, arrays, React fragments, null - whatever you like.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParatron%2Fhookrouter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FParatron%2Fhookrouter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParatron%2Fhookrouter/lists"}