{"id":23058666,"url":"https://github.com/suhdev/stickyants-react-router","last_synced_at":"2025-04-03T06:18:36.265Z","repository":{"id":44115087,"uuid":"170953669","full_name":"suhdev/stickyants-react-router","owner":"suhdev","description":"A basic react-router alternative using react hooks.","archived":false,"fork":false,"pushed_at":"2023-01-04T03:00:30.000Z","size":1126,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T20:13:44.752Z","etag":null,"topics":[],"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/suhdev.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-16T02:25:29.000Z","updated_at":"2023-04-14T23:43:46.000Z","dependencies_parsed_at":"2023-02-01T18:16:07.335Z","dependency_job_id":null,"html_url":"https://github.com/suhdev/stickyants-react-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-react-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-react-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-react-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhdev%2Fstickyants-react-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhdev","download_url":"https://codeload.github.com/suhdev/stickyants-react-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944383,"owners_count":20858772,"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":[],"created_at":"2024-12-16T02:16:55.370Z","updated_at":"2025-04-03T06:18:36.253Z","avatar_url":"https://github.com/suhdev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stickyants-react-router\n\nA simple `react-router` alternative. The package implements basic routing functionality using react hooks. \n\n\n## Usage\n\n```typescript\n\nimport * as React from 'react'; \nimport * as ReactDOM from 'react-dom';\n\nimport { Route, Router, createHashHistory } from 'stickyants-react-router';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nconst history = createHashHistory();\n\nfunction TestComponent(props) {\n  return (\u003cdiv\u003e\n    \u003cRoute path=\"#/home\"\u003e\n      \u003cdiv className=\"test-1\"\u003eHome\u003c/div\u003e\n    \u003c/Route\u003e\n    \u003cRoute path=\"#/home/page1\"\u003e\n      \u003cdiv className=\"test-2\"\u003e\n        \u003cdiv\u003ePage 1\u003c/div\u003e\n        \u003cRoute path=\"#/home/page1/sub-page1\"\u003e\n          \u003cdiv\u003ePage 1 - Sub Page\u003c/div\u003e\n        \u003c/Route\u003e\n      \u003c/div\u003e\n    \u003c/Route\u003e\n  \u003c/div\u003e);\n}\n\nlet el = document.getElementById('SomeElement');\nif (!el) {\n  el = document.createElement('div');\n  el.id = 'SomeElement';\n  document.querySelector('body').appendChild(el);\n}\n\n\nReactDOM.render(\n  \u003cRouter history={history}\u003e\n      \u003cRoute path=\"/\"\u003e\u003cdiv data-testid=\"tmx\"\u003eTMX\u003c/div\u003e\u003c/Route\u003e\n      \u003cRoute path=\"/test\"\u003e\u003cdiv data-testid=\"tmz\"\u003eTMZ\u003c/div\u003e\n        \u003cRoute path=\"/test/:id\"\u003e\n          \u003cdiv data-testid=\"nestedroute\"\u003eNESTED ROUTE\u003c/div\u003e\n        \u003c/Route\u003e\n\n        \u003cRoute path=\"/test/:id\" isExact={true}\u003e\n          \u003cdiv data-testid=\"samenestedroute\"\u003eSAME NESTED ROUTE\u003c/div\u003e\n        \u003c/Route\u003e\n        \u003cdiv\u003e\n          \u003cRoute path=\"/test/:id\"\u003e\n            \u003cdiv data-testid=\"anothernestedroute\"\u003eANOTHER NESTED ROUTE\u003c/div\u003e\n          \u003c/Route\u003e\n          \u003cRoute path=\"/test/element\"\u003e\n            \u003cdiv data-testid=\"stringnestedroute\"\u003eSTRING NESTED ROUTE\u003c/div\u003e\n          \u003c/Route\u003e\n          \u003cRoute path=\"/test/element/:id\"\u003e\n            \u003cdiv data-testid=\"elementnestedroute\"\u003eELEMENT NESTED ROUTE\u003c/div\u003e\n          \u003c/Route\u003e\n        \u003c/div\u003e\n      \u003c/Route\u003e\n      \u003cdiv data-testid=\"xyz\"\u003eXYZ\u003c/div\u003e\n      \u003cdiv\u003e\n        \u003cRoute path=\"/test123\"\u003e\u003cdiv data-testid=\"incorrect\"\u003eINCORRECT\u003c/div\u003e\u003c/Route\u003e\n      \u003c/div\u003e\n    \u003c/Router\u003e,\n  el);\n\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstickyants-react-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhdev%2Fstickyants-react-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhdev%2Fstickyants-react-router/lists"}