{"id":19700518,"url":"https://github.com/draftbit/react-nav-current-route-name","last_synced_at":"2026-04-30T07:37:48.620Z","repository":{"id":57341756,"uuid":"113234767","full_name":"draftbit/react-nav-current-route-name","owner":"draftbit","description":"🛣 🚴‍♀️ 🚧 Get the Current Route Name using React Navigation, Redux \u0026 Reselect","archived":false,"fork":false,"pushed_at":"2018-01-15T20:30:58.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-20T00:42:24.534Z","etag":null,"topics":["current-route","react-navigation","redux","reselect","route"],"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/draftbit.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":"2017-12-05T21:25:56.000Z","updated_at":"2019-02-10T19:11:04.000Z","dependencies_parsed_at":"2022-09-16T02:50:13.931Z","dependency_job_id":null,"html_url":"https://github.com/draftbit/react-nav-current-route-name","commit_stats":null,"previous_names":["preposterous/react-nav-current-route-name"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/draftbit/react-nav-current-route-name","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Freact-nav-current-route-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Freact-nav-current-route-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Freact-nav-current-route-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Freact-nav-current-route-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draftbit","download_url":"https://codeload.github.com/draftbit/react-nav-current-route-name/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draftbit%2Freact-nav-current-route-name/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32458237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["current-route","react-navigation","redux","reselect","route"],"created_at":"2024-11-11T21:06:18.181Z","updated_at":"2026-04-30T07:37:48.604Z","avatar_url":"https://github.com/draftbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛣 🚴‍♀️ 🚧  Current Route Name\n\nA memoized selector for redux + react-navigation that will expose the current route name for you!\n\n## Installation\n\n```\nyarn add react-nav-current-route-name\n```\n\n```\nnpm install --save react-nav-current-route-name\n```\n\n## Usage\n\nTwo ways:\n\n### 1 (as an HOC)\n\n1. import `getCurrentRoute`\n2. wrap it around your component\n3. You'll have `currentRoute` available to you with the name of the current route\n\n```es6\n// if this is the only HOC you have:\nimport { withCurrentRouteName } from 'react-nav-current-route-name'\nexport default withCurrentRouteName(MyComponent)\n\n// sometimes you'll have a few things using compose:\n\nexport default compose(\n  withCurrentRouteName,\n  withApollo,\n  withNavigation,\n  connectActionSheet\n)(MyComponent)\n\n// ...\n\ncomponentDidUpdate(nextProps) {\n  const { currentRoute } = this.props\n  const { currentRoute: nextRoute } = nextProps\n}\n```\n\n### 2 (using mapStateToProps)\n\n1. import `getCurrentRouteName`\n2. use it within your current `mapStateToProps` function\n3. You'll have `currentRoute` available to you with the name of the current route\n\n```es6\nimport { getCurrentRouteName } from 'react-nav-current-route-name'\n\nexport default connect(\n  mapStateToProps(state =\u003e {\n    return {\n      currentRoute: getCurrentRouteName(state.nav)\n    }\n  })\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraftbit%2Freact-nav-current-route-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdraftbit%2Freact-nav-current-route-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraftbit%2Freact-nav-current-route-name/lists"}