{"id":44935122,"url":"https://github.com/fredrikolovsson/react-native-viewability-tracking-view","last_synced_at":"2026-02-18T07:08:47.674Z","repository":{"id":45884384,"uuid":"332560374","full_name":"fredrikolovsson/react-native-viewability-tracking-view","owner":"fredrikolovsson","description":"A React Native View that provides similar viewability tracking as the FlatList, but better™","archived":false,"fork":false,"pushed_at":"2021-11-29T23:43:54.000Z","size":879,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T22:39:49.335Z","etag":null,"topics":["react-native","sensor","tracking","view","viewability","viewable","visibility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-viewability-tracking-view","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/fredrikolovsson.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}},"created_at":"2021-01-24T21:30:38.000Z","updated_at":"2023-02-25T22:12:20.000Z","dependencies_parsed_at":"2022-09-10T17:01:07.683Z","dependency_job_id":null,"html_url":"https://github.com/fredrikolovsson/react-native-viewability-tracking-view","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/fredrikolovsson/react-native-viewability-tracking-view","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredrikolovsson%2Freact-native-viewability-tracking-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredrikolovsson%2Freact-native-viewability-tracking-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredrikolovsson%2Freact-native-viewability-tracking-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredrikolovsson%2Freact-native-viewability-tracking-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredrikolovsson","download_url":"https://codeload.github.com/fredrikolovsson/react-native-viewability-tracking-view/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredrikolovsson%2Freact-native-viewability-tracking-view/sbom","scorecard":{"id":410453,"data":{"date":"2025-08-11","repo":{"name":"github.com/fredrikolovsson/react-native-viewability-tracking-view","commit":"85b90f7e4d2999e20d353e1a825e52722149b3ab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"51 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-f5x2-xv93-4p23","Warn: Project is vulnerable to: GHSA-gmpm-xp43-f7g6","Warn: Project is vulnerable to: GHSA-pf27-929j-9pmm","Warn: Project is vulnerable to: GHSA-327c-qx3v-h673","Warn: Project is vulnerable to: GHSA-x4cf-6jr3-3qvp","Warn: Project is vulnerable to: GHSA-mph8-6787-r8hw","Warn: Project is vulnerable to: GHSA-7mhc-prgv-r3q4","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-4cpg-3vgw-4877","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-gff7-g5r8-mg8m","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T22:34:38.823Z","repository_id":45884384,"created_at":"2025-08-18T22:34:38.823Z","updated_at":"2025-08-18T22:34:38.823Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29571905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T06:19:27.422Z","status":"ssl_error","status_checked_at":"2026-02-18T06:18:44.348Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","sensor","tracking","view","viewability","viewable","visibility"],"created_at":"2026-02-18T07:08:46.951Z","updated_at":"2026-02-18T07:08:47.661Z","avatar_url":"https://github.com/fredrikolovsson.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-viewability-tracking-view\n\n\u003e Note: This tracking uses `setInterval` and the native [`measure`](https://reactnative.dev/docs/direct-manipulation#measurecallback) method, which can affect your application's performance if used excessively\n\nIf you need to track how many times a View is visible on the screen, you can use this. It provides options for setting offsets (`offset*`), in case part of your screen is covered by fixed elements, e.g. a tab bar.\n\nAlso, you can configure what is considered enough to be \"seen\". By default, `onViewabilityChange` will be called when at least 50% (`itemVisiblePercentThreshold`) of the `ViewabilityTrackingView` has been rendered within the device's screen dimensions for at least 1000 ms (`minimumViewTime`).\n\nLastly, you can define how often the measurement is taken, which affects the accuracy of the tracking and the performance impact it has (`viewabilityMeasurementInterval`).\n\n## Example\n\n```tsx\nimport ViewabilityTrackingView, {\n  OnViewabilityParameters,\n} from 'react-native-viewability-tracking-view'\n\nexport const MyComponent = ({\n  isCurrentRoute,\n  title,\n}: {\n  isCurrentRoute: boolean\n  title: string\n}) =\u003e {\n  const onViewabilityChange = (data: OnViewabilityParameters) =\u003e {\n    /* do something */\n  }\n\n  return (\n    \u003cViewabilityTrackingView\n      enabled={isCurrentRoute} // to only track when relevant\n      accessibilityLabel={`Advertising banner ${title}`}\n      onViewabilityChange={onViewabilityChange}\n      testID=\"ViewabilityTrackingView\"\n      // check docs below for all props\n    \u003e\n      \u003cText\u003e{title}\u003c/Text\u003e\n    \u003c/ViewabilityTrackingView\u003e\n  )\n}\n```\n\n## Props\n\n```ts\nexport interface OnViewabilityCallbackParameters\u003c\n  Item extends Record\u003cstring, unknown\u003e = Record\u003cstring, never\u003e\n\u003e {\n  isInView: boolean\n  item?: Item\n  itemVisiblePercent: number\n  testID?: string\n  timeInView?: number\n  timeOutOfView?: number\n}\n\nexport interface ViewabilityTrackingViewProps\u003c\n  Item extends Record\u003cstring, unknown\u003e = Record\u003cstring, never\u003e\n\u003e extends ViewProps {\n  /**\n   * DEV ONLY: Set to true to get console.logs of the viewability, each time it's measured.\n   *\n   * @type {boolean}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  __DEV__debug?: boolean\n\n  children?: React.ReactNode\n\n  /**\n   * Requiring explicit opt-in to the tracking. This is to remind consumers that viewability tracking\n   * might affect performance, so ideally it should only be enabled when there is a chance that the\n   * content will come into view.\n   *\n   * @type {boolean}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  enabled: boolean\n\n  /**\n   * Minimum percent of pixels that need to be viewable for item to be considered in view. Defaults to 50.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  itemVisiblePercentThreshold?: number\n\n  /**\n   * Item is optional, but passed into the onViewability* callbacks.\n   *\n   * @type {OnMeasureParameters['item']}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  item?: Item\n\n  /**\n   * Minimum view time, in milliseconds, required to trigger onViewabilityChange. Defaults to 1000.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  minimumViewTime?: number\n\n  /**\n   * Use offsetBottom to set that amount of pixels as not viewable, e.g. if there is a fixed bottom\n   * bar that content can be scrolled behind, while still within the window of the device.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  offsetBottom?: number\n\n  /**\n   * Use offsetLeft to set that amount of pixels as not viewable, e.g. if there is a fixed sidebar\n   * that content can be scrolled behind, while still within the window of the device.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  offsetLeft?: number\n\n  /**\n   * Use offsetRight to set that amount of pixels as not viewable, e.g. if there is a fixed sidebar\n   * that content can be scrolled behind, while still within the window of the device.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  offsetRight?: number\n\n  /**\n   * Use offsetTop to set that amount of pixels as not viewable, e.g. if there is a fixed header\n   * that content can be scrolled behind, while still within the window of the device.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  offsetTop?: number\n\n  /**\n   * Called when the itemVisiblePercentThreshold and the minimumViewTime is met for the first time\n   * since coming into view and when going out of view after having been in view. In the latter case\n   * it does not matter for how long it had been in view before going out of view.\n   *\n   * @memberof ViewabilityTrackingViewProps\n   */\n  onViewabilityChange?: (params: OnViewabilityCallbackParameters) =\u003e void\n\n  /**\n   * Called on every viewability measurement, which is done at the viewabilityMeasurementInterval.\n   *\n   * @memberof ViewabilityTrackingViewProps\n   */\n  onViewabilityCheck?: (params: OnViewabilityCallbackParameters) =\u003e void\n\n  testID?: string\n\n  /**\n   * Time between viewability measurements, in milliseconds. Defaults to 200.\n   *\n   * @type {number}\n   * @memberof ViewabilityTrackingViewProps\n   */\n  viewabilityMeasurementInterval?: number\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredrikolovsson%2Freact-native-viewability-tracking-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredrikolovsson%2Freact-native-viewability-tracking-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredrikolovsson%2Freact-native-viewability-tracking-view/lists"}