{"id":4109,"url":"https://github.com/rauchy/react-native-offline-mode","last_synced_at":"2026-01-31T06:39:29.344Z","repository":{"id":66338111,"uuid":"55670512","full_name":"rauchy/react-native-offline-mode","owner":"rauchy","description":"Swap your app with an offline version while there's no connectivity","archived":false,"fork":false,"pushed_at":"2018-10-11T09:44:56.000Z","size":399,"stargazers_count":188,"open_issues_count":4,"forks_count":38,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-15T00:20:06.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/rauchy.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}},"created_at":"2016-04-07T06:46:15.000Z","updated_at":"2024-03-25T11:10:49.000Z","dependencies_parsed_at":"2023-02-24T23:00:32.922Z","dependency_job_id":null,"html_url":"https://github.com/rauchy/react-native-offline-mode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rauchy%2Freact-native-offline-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rauchy%2Freact-native-offline-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rauchy%2Freact-native-offline-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rauchy%2Freact-native-offline-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rauchy","download_url":"https://codeload.github.com/rauchy/react-native-offline-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228248551,"owners_count":17891447,"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":[],"created_at":"2024-01-05T20:17:01.329Z","updated_at":"2026-01-31T06:39:29.313Z","avatar_url":"https://github.com/rauchy.png","language":"Objective-C","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"# react-native-offline-mode\nA higher-order component for React Native which will conditionally show a component OR something else depending on internet connection availability.\n\n[![ScreenShot](https://raw.githubusercontent.com/rauchy/react-native-offline-mode/master/example.gif)]\n\nInstall\n-------\n\nMake sure that you are in your React Native project directory and run:\n\n```npm install react-native-offline-mode --save```\n\n## Usage\n\nImport `RequiresConnection` as a JavaScript module:\n\n```js\nimport RequiresConnection from 'react-native-offline-mode';\n```\n\nThen simply wrap whichever component you want to be connection-aware with a call to `RequiresConnection`. Take a look at the [example project](https://github.com/rauchy/react-native-offline-mode/tree/master/example) or simply [this commit](https://github.com/rauchy/react-native-offline-mode/commit/ad8a892bcc2dfc15c8d1fe6fda5da17911e59b61).\n\n### Showing a default \"no connectivity\" message\n\nFor example, if you want the entire app to go on hold with a \"no connectivity\" message, simply wrap your main component:\n\n```js\nmodule.exports = RequiresConnection(Main)\n```\n\n### Specifying a custom message\n\nIf you want to display a different message, simply pass it as a second parameter to `RequiresConnection`:\n\n```js\nmodule.exports = RequiresConnection(Main, 'no internetz for you :(')\n```\n\n### Using a custom offline component\n\nInstead of just showing a message, you can have your app deliver different functionality when offline. To accomplish this, simply pass in the offline component as a second parameter:\n\n```js\nmodule.exports = RequiresConnection(OnlineMain, OfflineMain)\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/rauchy/react-native-offline-mode/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frauchy%2Freact-native-offline-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frauchy%2Freact-native-offline-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frauchy%2Freact-native-offline-mode/lists"}