{"id":19563353,"url":"https://github.com/cvpcasada/use-measure","last_synced_at":"2025-09-13T05:46:35.031Z","repository":{"id":47409740,"uuid":"169742511","full_name":"cvpcasada/use-measure","owner":"cvpcasada","description":"It's just a React hook for resize-observer, uses resize-observer-polyfill.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:51:51.000Z","size":563,"stargazers_count":25,"open_issues_count":10,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T11:28:56.013Z","etag":null,"topics":["hook","react","react-hooks","resize-observer"],"latest_commit_sha":null,"homepage":null,"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/cvpcasada.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":"2019-02-08T13:55:44.000Z","updated_at":"2024-06-19T13:33:05.000Z","dependencies_parsed_at":"2023-02-02T21:15:57.710Z","dependency_job_id":null,"html_url":"https://github.com/cvpcasada/use-measure","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cvpcasada/use-measure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvpcasada%2Fuse-measure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvpcasada%2Fuse-measure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvpcasada%2Fuse-measure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvpcasada%2Fuse-measure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvpcasada","download_url":"https://codeload.github.com/cvpcasada/use-measure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvpcasada%2Fuse-measure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274922671,"owners_count":25374519,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hook","react","react-hooks","resize-observer"],"created_at":"2024-11-11T05:17:29.462Z","updated_at":"2025-09-13T05:46:35.004Z","avatar_url":"https://github.com/cvpcasada.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-measure\n\nIt's just a React hook for resize-observer, uses resize-observer-polyfill. Inspired by [react-measure](https://github.com/souporserious/react-measure)\n\n## Install\n\n\u003e Note: React 16.8+ is required for Hooks.\n\n### With npm\n\n```sh\nnpm i use-measure --save\n```\n\n### Or with yarn\n\n```sh\nyarn add use-measure\n```\n\n## Usage\n\n```jsx\nimport { useRef } from \"react\";\nimport useMeasure from \"use-measure\";\n\nfunction MeasuredDiv() {\n  const nodeRef = useRef();\n  const measurement = useMeasure(nodeRef);\n  \n  // do whatever you want with measurement obj.\n  // note that measurement will only be available after first render.\n  return (\n    \u003cdiv ref={nodeRef}\u003e\n      /* ... */\n    \u003c/div\u003e;\n  );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvpcasada%2Fuse-measure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvpcasada%2Fuse-measure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvpcasada%2Fuse-measure/lists"}