{"id":18325224,"url":"https://github.com/kanzitelli/rnn-screens","last_synced_at":"2025-04-06T00:31:11.627Z","repository":{"id":37753113,"uuid":"422313592","full_name":"kanzitelli/rnn-screens","owner":"kanzitelli","description":"🃏 Predictable Navigation for React Native.","archived":false,"fork":false,"pushed_at":"2023-01-17T23:41:06.000Z","size":644,"stargazers_count":27,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T22:57:41.831Z","etag":null,"topics":["react","react-native","react-native-navigaiton-screens","react-native-navigation","react-navigation","rnn-screens","rnn-starter"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kanzitelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-28T18:25:36.000Z","updated_at":"2024-01-30T19:32:49.000Z","dependencies_parsed_at":"2022-09-26T16:22:24.637Z","dependency_job_id":null,"html_url":"https://github.com/kanzitelli/rnn-screens","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzitelli%2Frnn-screens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzitelli%2Frnn-screens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzitelli%2Frnn-screens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanzitelli%2Frnn-screens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanzitelli","download_url":"https://codeload.github.com/kanzitelli/rnn-screens/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"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","react-native","react-native-navigaiton-screens","react-native-navigation","react-navigation","rnn-screens","rnn-starter"],"created_at":"2024-11-05T18:40:13.885Z","updated_at":"2025-04-06T00:31:10.690Z","avatar_url":"https://github.com/kanzitelli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://xxx-files.ggc.team/oss/rnn-screens/cover.png\" width=\"80%\" title=\"Logo\"\u003e\n\u003c/p\u003e\n\n☣️ `Experiment` \u003ci\u003eThis is an experimental library and may have breaking changes in the future.\u003c/i\u003e\n\n## Goal\n\nThe goal of [RNN Screens](https://github.com/kanzitelli/rnn-screens) is to provide React Native developers with more simplified and predictable Navigation. It's built on top of [React Native Navigation](https://github.com/wix/react-native-navigation).\n\n## Quick start\n\n### Starters\n\n1. [starters-dev/rnn-with-expo](https://github.com/starters-dev/rnn-with-expo) - minimalistic starter with React Native Navigation, Expo Modules and **RNN Screens**.\n\n2. [rnn-starter](https://github.com/kanzitelli/rnn-starter) - more advanced starter that is powered by cli-rn, React Native Navigation, Expo Modules, **RNN Screens**, RN UI lib, MMKV, Mobx, Reanimated 2, Dark Mode, Localization, Notifications, Permissions, and much more.\n\n### Bare RNN\n\n#### 1. Install [React Native Navigation](https://github.com/wix/react-native-navigation) and RNN Screens\n\n```\n\u003e yarn add react-native-navigation rnn-screens\n\u003e npx rnn-link\n\u003e npx pod-install\n```\n\nIf you had problems installing RNN, please follow more [detailed tutorial](https://wix.github.io/react-native-navigation/docs/installing)\n\n#### 2. Build screen components\n\n```tsx\nimport {generateRNNScreens, Root, BottomTabs, Screen, ScreenComponent} from 'rnn-screens';\n\n// src/screens/main.tsx\nexport const Main: ScreenComponent = ({componentId}) =\u003e {\n  return \u003c\u003e...\u003c/\u003e;\n};\n\n// src/screens/settings.tsx\ntype SettingsProps = {type: 'push' | 'show'};\nexport const Settings: ScreenComponent\u003cSettingsProps\u003e = ({componentId, type}) =\u003e {\n  return \u003c\u003e...\u003c/\u003e;\n};\n```\n\n#### 3. Describe screens\n\n```tsx\n// src/screens/index.tsx\n\nimport {generateRNNScreens} from 'rnn-screens';\nimport {Main} from './main';\nimport {Settings} from './settings';\n\nexport const screens = generateRNNScreens({\n  Main: {\n    component: Main,\n    options: {\n      topBar: {title: {text: 'Home'}},\n    },\n  },\n  Settings: {\n    component: Settings,\n    options: {\n      topBar: {title: {text: 'Settings'}},\n    },\n  },\n});\n```\n\n#### 4. Build root component\n\n```tsx\n// App.tsx\n\n// single screen app\nexport const App = () =\u003e Root(Screen(screens.get('Main')));\n\n// tab based app\nexport const TabsApp = () =\u003e\n  Root(\n    BottomTabs([\n      Screen(screens.get('Main')),\n      Screen(screens.get('Settings'))\n    ])\n  );\n```\n\n#### 5. Update `index.js`\n\n```tsx\n// index.js\n\nimport {registerRootComponent} from 'rnn-screens';\nimport {App} from './App';\n\nregisterRootComponent(App);\n```\n\n#### 6. Navigate with predictability\n\n```tsx\n// navigate from any screen\n\n// push screen\nscreens.push(componentId, 'Settings');\n\n// show modal\nscreens.show('Settings');\n\n// push screen with passProps\nscreens.push\u003cSettingsProps\u003e(componentId, 'Settings', {type: 'push'});\n\n// use RNN Navigation instance\nscreens.N.dismissAllModals();\n```\n\n## Enhancements\n\nFeel free to open an issue for suggestions.\n\n## Credits\n\nThanks to the [React Native Navigation](https://github.com/wix/react-native-navigation) team @ Wix!\n\n## License\n\nThis project is [MIT licensed](https://github.com/kanzitelli/rnn-screens/blob/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanzitelli%2Frnn-screens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanzitelli%2Frnn-screens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanzitelli%2Frnn-screens/lists"}