{"id":19110457,"url":"https://github.com/pbr1111/use-resize-observer","last_synced_at":"2026-04-11T16:43:33.741Z","repository":{"id":42731582,"uuid":"283551638","full_name":"pbr1111/use-resize-observer","owner":"pbr1111","description":"React hook implementation of ResizeObserver to measure the size of an element.","archived":false,"fork":false,"pushed_at":"2023-09-14T11:48:44.000Z","size":1104,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-23T12:11:03.650Z","etag":null,"topics":["hooks","react","resize-observer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/pbr1111.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-07-29T16:41:44.000Z","updated_at":"2023-09-14T11:13:32.000Z","dependencies_parsed_at":"2023-02-08T01:15:15.949Z","dependency_job_id":null,"html_url":"https://github.com/pbr1111/use-resize-observer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pbr1111/use-resize-observer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbr1111%2Fuse-resize-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbr1111%2Fuse-resize-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbr1111%2Fuse-resize-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbr1111%2Fuse-resize-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pbr1111","download_url":"https://codeload.github.com/pbr1111/use-resize-observer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pbr1111%2Fuse-resize-observer/sbom","scorecard":{"id":724917,"data":{"date":"2025-08-11","repo":{"name":"github.com/pbr1111/use-resize-observer","commit":"f0ae229cd6faeaab9608e2830b2a416814cbc91c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/pbr1111/use-resize-observer/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/pbr1111/use-resize-observer/npm-publish.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 1 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":"42 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-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","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-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","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-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-22T12:29:52.978Z","repository_id":42731582,"created_at":"2025-08-22T12:29:52.978Z","updated_at":"2025-08-22T12:29:52.978Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["hooks","react","resize-observer"],"created_at":"2024-11-09T04:25:04.123Z","updated_at":"2026-04-11T16:43:33.724Z","avatar_url":"https://github.com/pbr1111.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-resize-observer\n\n[![npm version](https://badge.fury.io/js/%40pbr1111%2Fuse-resize-observer.svg)](https://badge.fury.io/js/%40pbr1111%2Fuse-resize-observer)\n![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@pbr1111/use-resize-observer)\n\nReact hook implementation of ResizeObserver to measure the size of an element.\n\n-   [Features](#features)\n-   [Installation](#installation)\n-   [Usage](#usage)\n    -   [useResizeObserver](#useResizeObserver)\n    -   [useDebounceResizeObserver](#useDebounceResizeObserver)\n    -   [useThrottleResizeObserver](#useThrottleResizeObserver)\n\n# Features\n\n-   Uses RefCallback to react to nodes that change their reference (like conditional nodes).\n-   Provides useDebounceResizeObserver and useThrottleResizeObserver hooks for an optimized debouncing and throttling exprience, avoiding unnecessary rerenders.\n-   Written in TypeScript. The declaration files (.d.ts) are included in the package.\n\n# Installation\n\nWith yarn:\n\n```sh\nyarn add @pbr1111/use-resize-observer\n```\n\nWith npm:\n\n```sh\nnpm install @pbr1111/use-resize-observer\n```\n\n# Usage\n\nAll hooks return the same object:\n\n| Property | Description                                                                       |\n| -------- | --------------------------------------------------------------------------------- |\n| `ref`    | RefCallback `ref` to be observed                                                  |\n| `width`  | Element width. It will be undefined until the size of the element is calculated.  |\n| `height` | Element height. It will be undefined until the size of the element is calculated. |\n\n## useResizeObserver\n\n### Parameters\n\nThis hook has no input parameters.\n\n### Example\n\n```tsx\nimport React from 'react';\nimport { useResizeObserver } from '@pbr1111/use-resize-observer';\n\nconst App = () =\u003e {\n    const { ref, width, height } = useResizeObserver\u003cHTMLDivElement\u003e();\n\n    return (\n        \u003cdiv ref={ref}\u003e\n            \u003cdiv\u003eWidth: {width}px\u003c/div\u003e\n            \u003cdiv\u003eHeight: {height}px\u003c/div\u003e\n        \u003c/div\u003e\n    );\n};\n```\n\n## useDebounceResizeObserver\n\n### Parameters\n\n| Parameter | Required | Description                 |\n| --------- | -------- | --------------------------- |\n| `delayMs` | Yes      | Delay time in milliseconds. |\n\n### Example\n\n```tsx\nimport React from 'react';\nimport { useDebounceResizeObserver } from '@pbr1111/use-resize-observer';\n\nconst App = () =\u003e {\n    const { ref, width, height } = useDebounceResizeObserver\u003cHTMLDivElement\u003e(\n        500\n    );\n\n    return (\n        \u003cdiv ref={ref}\u003e\n            \u003cdiv\u003eWidth: {width}px\u003c/div\u003e\n            \u003cdiv\u003eHeight: {height}px\u003c/div\u003e\n        \u003c/div\u003e\n    );\n};\n```\n\n## useThrottleResizeObserver\n\n### Parameters\n\n| Parameter | Required | Description                 |\n| --------- | -------- | --------------------------- |\n| `delayMs` | Yes      | Delay time in milliseconds. |\n\n### Example\n\n```tsx\nimport React from 'react';\nimport { useThrottleResizeObserver } from '@pbr1111/use-resize-observer';\n\nconst App = () =\u003e {\n    const { ref, width, height } = useThrottleResizeObserver\u003cHTMLDivElement\u003e(\n        500\n    );\n\n    return (\n        \u003cdiv ref={ref}\u003e\n            \u003cdiv\u003eWidth: {width}px\u003c/div\u003e\n            \u003cdiv\u003eHeight: {height}px\u003c/div\u003e\n        \u003c/div\u003e\n    );\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbr1111%2Fuse-resize-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpbr1111%2Fuse-resize-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpbr1111%2Fuse-resize-observer/lists"}