{"id":24794058,"url":"https://github.com/scout-nu/route-lite","last_synced_at":"2025-10-12T20:30:29.125Z","repository":{"id":57355678,"uuid":"105494593","full_name":"Scout-NU/route-lite","owner":"Scout-NU","description":"A lightweight, URL-free router for React applications for use in Chrome extensions or Electron apps","archived":false,"fork":false,"pushed_at":"2018-04-11T16:16:20.000Z","size":82,"stargazers_count":54,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-11-12T12:58:06.813Z","etag":null,"topics":["react","reactjs","router"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Scout-NU.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-10-02T03:27:28.000Z","updated_at":"2024-01-12T15:30:39.000Z","dependencies_parsed_at":"2022-09-27T10:50:26.757Z","dependency_job_id":null,"html_url":"https://github.com/Scout-NU/route-lite","commit_stats":null,"previous_names":["aem/route-lite"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scout-NU%2Froute-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scout-NU%2Froute-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scout-NU%2Froute-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scout-NU%2Froute-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Scout-NU","download_url":"https://codeload.github.com/Scout-NU/route-lite/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236268261,"owners_count":19121810,"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":["react","reactjs","router"],"created_at":"2025-01-29T22:32:25.288Z","updated_at":"2025-10-12T20:30:28.780Z","avatar_url":"https://github.com/Scout-NU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# route-lite\n\nRoute Lite is a simple, small (2.2kb minified), stack-based router that allows basic navigation by pushing to and popping from the router's state.\n\n## Table of Contents\n\n* [Background](#background)\n* [Installation](#installation)\n* [Usage](#usage)\n* [API](#api)\n* [Maintainers](#maintainers)\n* [Code of Conduct](#code-of-conduct)\n* [Contributing](#contributing)\n* [License](#license)\n* [About Scout](#about-scout)\n\n## Installation\n\n```sh\n# npm \u003c 5\nnpm install route-lite --save\n\n# npm \u003e= 5\nnpm install route-lite\n\n# Yarn\nyarn add route-lite\n```\n\n## Usage\n\nRoute Lite has a simple API that makes it easy to get started with no config. No declaring routes, no config file, just render the parent component and push components to the stack:\n\n```jsx\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Router, { Link, goBack } from 'route-lite';\n\nconst A = () =\u003e {\n  return (\n    \u003cLink\n      component={B}\n      componentProps={{text: \"Component B\"}}\n    \u003e\n      Component A\n    \u003c/Link\u003e\n  );\n}\n\nconst B = ({text}) =\u003e {\n  return \u003cdiv onClick={() =\u003e goBack()}\u003e{text}\u003c/div\u003e\n}\n\nReactDOM.render(\u003cRouter\u003e\u003cA /\u003e\u003c/Router\u003e, document.querySelector('body'));\n```\n\nThe library is also available as a UMD or CommonJS build.\n\n## API\n\nThe library exports three objects:\n\n```js\nexport default class Router extends React.Component { /* ... */ }\nexport function goTo(component: ReactComponent, props: object) { /* ... */ }\nexport function goBack()\n```\n\n#### `\u003cRouter /\u003e`\n\nThe `Router` class is a React component that accepts no props, but can have children. The children of `Router` will be rendered when no known components are available in the Router's history.\n\nThe `Router` should be placed at the application root.\n\n#### `\u003cLink /\u003e`\n\nThe `Link` component is a convient way to link to an external website or a new component wihtout manually calling `goTo`. Accepted properties are:\n\n```js\nLink.propTypes = {\n  href: PropTypes.string,  // to direct to an external site\n  component: PropTypes.instanceOf(React.Component),  // to put a new component on the stack\n  componentProps: PropTypes.object,\n  className: PropTypes.string,\n  id: PropTypes.string,\n  onClick: PropTypes.func,\n}\n```\n\n**NOTE:** There is a \"whitelist\" of sorts for props, only `data-` props will be propogated down to the child link component.\n\n#### `goTo(component, props)`\n\nThe `goTo` method accepts two arguments, a component and props. These must be separated so they can be kept in history without having to keep all components rendered at once.\n\n#### `goBack()`\n\n`goBack` will simply pop the last history item off the stack, effectively returning to the previous screen.\n\n## Maintainers\n\n#### Adam Markon\n\n_Email_: [amarkon895@gmail.com](mailto:amarkon895@gmail.com)\n\n_Twitter_: [@amarkon88](https://twitter.com/amarkon88)\n\n## Code of Conduct\n\nScout strives to provide a welcoming, inclusive environment for all users, period. To hold ourselves accountable to that mission, Scout has a strictly-enforced [code of conduct](https://github.com/Scout-NU/open-source/blob/develop/CODE_OF_CONDUCT.md). Violating those rules will result in removal from the Scout organization, and potentially being banned from contributing to our projects.\n\n## Contributing\n\nWe welcome all contributions to our projects! Filing bugs, feature requests, code changes, docs changes, or anything else you'd like to contribute are all more than welcome! More information about contributing to Scout projects can be found in our [contributors' guide](/CONTRIBUTING.md)!\n\n## License\n\nAll Scout libraries are [ISC-licensed](/LICENSE). tl;dr: you can use this code however you'd like, just please attribute us appropriately!\n\n## About Scout\n\n\u003cp  align=\"center\"\u003e\n  \u003cimg src=\"https://web.northeastern.edu/scout/wp-content/themes/scout/images/logo.png\" alt=\"Scout Logo\" /\u003e\n\u003c/p\u003e\n\nScout is Northeastern University's student-led design studio. The Studio has about 45 members selected via interview and application processes to select the university's best talent. Each semester the studio produces design and development assets for four ventures. Check out our [portfolio](https://web.northeastern.edu/scout/portfolio) for some past projects!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscout-nu%2Froute-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscout-nu%2Froute-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscout-nu%2Froute-lite/lists"}