Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dom-resize-observer

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dom-resize-observer - npm Package Compare versions

Comparing version 0.2.1 to 1.0.0

6

package.json
{
"name": "react-dom-resize-observer",
"version": "0.2.1",
"description": "",
"version": "1.0.0",
"description": "React hook implementing the Resize Observer API.",
"main": "./dist/index.js",

@@ -10,3 +10,3 @@ "scripts": {

},
"author": "Zak Nichols",
"author": "Zakary Nichols",
"license": "MIT",

@@ -13,0 +13,0 @@ "devDependencies": {

@@ -5,5 +5,5 @@ # React Resize Observer

[![codecov](https://codecov.io/gh/zaknicholsdev/react-dom-resize-observer/branch/develop/graph/badge.svg)](https://codecov.io/gh/zaknicholsdev/react-dom-resize-observer)
[![codecov](https://codecov.io/gh/zakarynichols/react-dom-resize-observer/branch/develop/graph/badge.svg)](https://codecov.io/gh/zaknicholsdev/react-dom-resize-observer)
![Workflow](https://github.com/zaknicholsdev/react-dom-resize-observer/actions/workflows/ci-cd.yml/badge.svg?branch=develop)
![Workflow](https://github.com/zakarynichols/react-dom-resize-observer/actions/workflows/ci-cd.yml/badge.svg?branch=develop)

@@ -27,6 +27,7 @@

// Callback to disconnect observing completely.
disconnect
disconnect,
// Callback to unobserve a specific element.
unobserve
} =
// Pass the same DOM element type as a type param to help the hook infer the correct types.
useResizeObserver<HTMLDivElement | null>({

@@ -36,3 +37,3 @@ // You can optionally pass your own ref if you already have one.

// You can optionally pass a callback to access the raw DOM element on resize.
onResize: (el) => { /** Do something with the element... */ },
onResize: (el) => { /** Access the element on resize... */ },
});

@@ -39,0 +40,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc