{"id":46613429,"url":"https://github.com/chooin/react-native-lifecycle","last_synced_at":"2026-03-07T19:05:58.898Z","repository":{"id":40321144,"uuid":"287417610","full_name":"chooin/react-native-lifecycle","owner":"chooin","description":"React Native Lifecycle","archived":false,"fork":false,"pushed_at":"2023-12-07T03:33:18.000Z","size":460,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T11:11:54.293Z","etag":null,"topics":["react-native","react-native-hooks","react-native-lifecycle"],"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/chooin.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-14T01:43:08.000Z","updated_at":"2024-01-29T03:43:27.000Z","dependencies_parsed_at":"2024-06-20T21:59:56.052Z","dependency_job_id":null,"html_url":"https://github.com/chooin/react-native-lifecycle","commit_stats":{"total_commits":98,"total_committers":1,"mean_commits":98.0,"dds":0.0,"last_synced_commit":"00c9a19debbe0039e2a5eb01594d9aee045c17af"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/chooin/react-native-lifecycle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chooin%2Freact-native-lifecycle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chooin%2Freact-native-lifecycle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chooin%2Freact-native-lifecycle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chooin%2Freact-native-lifecycle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chooin","download_url":"https://codeload.github.com/chooin/react-native-lifecycle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chooin%2Freact-native-lifecycle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30226835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["react-native","react-native-hooks","react-native-lifecycle"],"created_at":"2026-03-07T19:05:58.336Z","updated_at":"2026-03-07T19:05:58.878Z","avatar_url":"https://github.com/chooin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Lifecycle\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/chooin/react-native-lifecycle/blob/master/LICENSE)\n[![Latest Version on NPM](https://img.shields.io/npm/v/react-native-lifecycle.svg)](https://npmjs.com/package/react-native-lifecycle)\n[![npm](https://img.shields.io/npm/dt/react-native-lifecycle.svg)](https://www.npmjs.com/package/react-native-lifecycle)\n[![build status](https://github.com/chooin/react-native-lifecycle/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/chooin/react-native-lifecycle/actions/workflows/test.yml)\n\n[简体中文](./README.zh-CN.md)\n\n### Install\n\n```sh\nyarn add react-native-lifecycle\n```\n\n### Peer Dependencies\n\n```sh\nyarn add @react-navigation/native # \u003e= 5.7.0 or \u003e= 6.0.0\n```\n\n### Support\n\n| package name           | version | react-native version |\n| ---------------------- | ------- | -------------------- |\n| react-native-lifecycle | 2.0.0+  | 0.65.0+              |\n| react-native-lifecycle | 1.2.4+  | 0.59.0+              |\n\n### Usage\n\n[Example](https://github.com/Chooin/react-native-lifecycle-example)\n\n##### Global Hooks\n\n```js\nimport { useAppActive, useAppInactive } from 'react-native-lifecycle';\n\nexport default function App() {\n  // Called when the application switches from the background to the foreground\n  useAppActive(() =\u003e {});\n\n  // Called when the application switches from the foreground to background\n  useAppInactive(() =\u003e {});\n}\n```\n\n##### Page/Screen Hooks\n\n```js\nimport {\n  useMount,\n  useShow,\n  useHide,\n  useUnmount,\n  useResize,\n} from 'react-native-lifecycle';\n\nexport default function Page() {\n  // Called when the page or component is mounted\n  useMount(() =\u003e {});\n\n  // Called when the page is displayed, or when the application switches from the background to the foreground\n  useShow(() =\u003e {});\n\n  // Called when the page is hidden, or when the application switches from the foreground to the background\n  useHide(() =\u003e {});\n\n  // Called when the page or component is unmounted\n  useUnmount(() =\u003e {});\n\n  // Called after the page window resize\n  useResize(() =\u003e {});\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchooin%2Freact-native-lifecycle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchooin%2Freact-native-lifecycle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchooin%2Freact-native-lifecycle/lists"}