{"id":17103357,"url":"https://github.com/farwayer/react-native-enroute","last_synced_at":"2026-05-02T05:38:35.069Z","repository":{"id":57336768,"uuid":"72800489","full_name":"farwayer/react-native-enroute","owner":"farwayer","description":"Simple and fast React Native router","archived":false,"fork":false,"pushed_at":"2022-10-25T11:23:55.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T23:28:52.409Z","etag":null,"topics":["enroute","navigation","navigator","react-native","react-navigation","router","stack"],"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/farwayer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-11-04T00:53:50.000Z","updated_at":"2022-10-25T11:22:08.000Z","dependencies_parsed_at":"2022-09-11T12:31:11.886Z","dependency_job_id":null,"html_url":"https://github.com/farwayer/react-native-enroute","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farwayer%2Freact-native-enroute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farwayer%2Freact-native-enroute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farwayer%2Freact-native-enroute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farwayer%2Freact-native-enroute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farwayer","download_url":"https://codeload.github.com/farwayer/react-native-enroute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farwayer%2Freact-native-enroute/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259146816,"owners_count":22812313,"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":["enroute","navigation","navigator","react-native","react-navigation","router","stack"],"created_at":"2024-10-14T15:33:09.388Z","updated_at":"2026-05-02T05:38:35.063Z","avatar_url":"https://github.com/farwayer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Enroute\n\n_Simple and fast React Native router based on react-enroute and native navigation_\n\n[![NPM version](https://img.shields.io/npm/v/react-native-enroute.svg)](https://www.npmjs.com/package/react-native-enroute)\n\nTo be honest it is not real router at all. This package contains some wrappers\nfor using [react-enroute](https://github.com/tj/react-enroute)\nwith [react-native-screens](https://github.com/software-mansion/react-native-screens).\nLibrary plays well with Redux and MobX.\n\n## Usage\n\n```bash\nyarn add react-native-enroute react-enroute react-native-screens @react-navigation/native @react-navigation/native-stack\n```\n\n```js\nimport {Router} from 'react-enroute'\nimport {State, createStack} from 'react-native-enroute'\nimport {ThemeProvider, PreventRemoveProvider} from '@react-navigation/core'\nimport {DefaultTheme} from '@react-navigation/native'\n\nfunction Routes({\n  location,\n  paths,\n  onNavigateBack,\n}) {\n  const ShopTab = createStack({paths, onNavigateBack})\n  const QuestTab = createStack({paths, onNavigateBack})\n\n  return (\n    \u003cThemeProvider value={DefaultTheme}\u003e\n\t    \u003cPreventRemoveProvider\u003e\n\t\t\t\t\u003cRouter {...{location}}\u003e\n\t\t\t\t\t\u003cShopTab path='/shops'\u003e\n\t\t\t\t\t\t\u003cShopList/\u003e\n\t\t\t\t\t\t\u003cShop path=':id'/\u003e\n\t\t\t\t\t\u003c/ShopTab\u003e\n\t\t\t\t\t\u003cQuestTab path='/quest'\u003e\n\t\t\t\t\t\t\u003cAllQuestions/\u003e\n\t\t\t\t\t\t\u003cQuestion path=':id'/\u003e\n\t\t\t\t\t\u003c/QuestTab\u003e\n\t\t\t\t\u003c/Router\u003e\n\t\t\t\u003c/PreventRemoveProvider\u003e\n\t\t\u003c/ThemeProvider\u003e\n  )\n}\n\nfunction App() {\n  const routerState = useMemo(() =\u003e new State('/shops'), [])\n  const pop = useCallback(() =\u003e {\n    routerState.pop()\n    return true\n  }, [])\n  \n  const openShop123 = useCallback(() =\u003e {\n    routerState.push('/shops/123')\n  }, [])\n  const resetToQuest1 = useCallback(() =\u003e {\n    routerState.reset('/quest/1')\n  }, []) \n\n  useEffect(() =\u003e {\n    BackHandler.addEventListener('hardwareBackPress', pop)\n\n    return () =\u003e {\n      BackHandler.removeEventListener('hardwareBackPress', pop)\n    }\n  }, [])\n\n  return (\n    \u003cView\u003e\n      \u003cButton onPress={openShop123}/\u003e\n      \u003cButton onPress={resetToQuest1}/\u003e\n      \u003cRoutes\n        location={routerState.current}\n        paths={routerState.paths}\n        onNavigateBack={pop}\n      /\u003e\n    \u003c/View\u003e\n  )\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarwayer%2Freact-native-enroute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarwayer%2Freact-native-enroute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarwayer%2Freact-native-enroute/lists"}