{"id":19142453,"url":"https://github.com/eldoy/router-link","last_synced_at":"2026-04-11T20:32:19.342Z","repository":{"id":139868731,"uuid":"145945815","full_name":"eldoy/router-link","owner":"eldoy","description":"React router done right","archived":false,"fork":false,"pushed_at":"2018-10-11T04:18:24.000Z","size":290,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-22T19:24:53.141Z","etag":null,"topics":["react","reactjs","router"],"latest_commit_sha":null,"homepage":"","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/eldoy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-24T05:21:39.000Z","updated_at":"2022-06-04T21:55:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfc6a8e1-69a8-4c3b-8f8b-1b9634b60728","html_url":"https://github.com/eldoy/router-link","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eldoy/router-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frouter-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frouter-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frouter-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frouter-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/router-link/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Frouter-link/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31695158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T20:18:30.949Z","status":"ssl_error","status_checked_at":"2026-04-11T20:18:29.982Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["react","reactjs","router"],"created_at":"2024-11-09T07:27:18.984Z","updated_at":"2026-04-11T20:32:19.307Z","avatar_url":"https://github.com/eldoy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Router Link React router\n\nMade out of frustration with the horrible `react-router`, the Router Link library is incredibly easy to use.\n\n### INSTALLATION\n\n`npm i router-link` or `yarn add router-link`\n\n### USAGE\n\nAn example application can be found here: [React App Boilerplate with Mobx](https://github.com/fugroup/react-base)\n\n```javascript\n// Define your routes in a file called routes.js\nimport Home from '@/views/Home.js'\nimport About from '@/views/About.js'\nimport Login from '@/views/Login.js'\nimport Chat from '@/views/Chat.js'\nimport NotFound from '@/views/NotFound.js'\n\nconst routes = [\n  { path: '/', view: Home },\n  { path: '/about', view: About },\n  { path: '/login', view: Login },\n  { path: '/chat', view: Chat },\n  { path: '*', view: NotFound }\n]\n\nexport default routes\n\n\n// In your App.js, the top level component, include your routes\n// and pass them as the 'routes' prop to \u003cRouter\u003e\nimport React, { Component } from 'react'\nimport { Router } from '@/router-link'\nimport Navigation from '@/components/Navigation.js'\nimport routes from './routes.js'\nimport './App.css'\n\nclass App extends Component {\n  render() {\n    return (\n      \u003cdiv className=\"App\"\u003e\n        \u003cheader className=\"App-header\"\u003e\n          \u003cNavigation/\u003e\n        \u003c/header\u003e\n        \u003cmain className=\"App-main\"\u003e\n          \u003cRouter routes={ routes }/\u003e\n        \u003c/main\u003e\n      \u003c/div\u003e\n    )\n  }\n}\n\nexport default App\n\n\n// Use the Link to create links for navigation\n// They will create a-tags with an active class for styling.\nimport React, { Component } from 'react'\nimport { Link } from '@/router-link'\nimport { store } from '@/store.js'\n\nclass Home extends Component {\n  render() {\n    return (\n      \u003cLink to=\"/login\"\u003eLog in\u003c/Link\u003e to get started!\n    )\n  }\n}\n\nexport default Home\n```\n\n### NAVIGATION\n\nIn your components you can use the `router.push('/path')` to programmatically trigger a route:\n\n```javascript\n// Import the router library\nimport { router } from 'router-link'\n\n// Do this anywhere inside your component to redirect\nrouter.push('/login')\n```\n\n### DYNAMIC ROUTES\n\nDefine dynamic routes by adding a `:` in front of the sub-path, and get the parameters as props:\n\n```javascript\n// Define route with parameters\nconst routes = [\n  { path: '/messages/:id', view: Messages }\n]\n\n// Use like this\n\u003cLink to={ `/messages/${ message.id }` }\u003eMessage\u003c/Link\u003e\n```\n\nIn this case the the `id` will be available as `this.props.route.id` in your component.\n\n\n### LICENSE\n\nMIT Licensed. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Frouter-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Frouter-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Frouter-link/lists"}