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

@reach/rect

Package Overview
Dependencies
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reach/rect - npm Package Compare versions

Comparing version 0.15.3 to 0.16.0

19

dist/reach-rect.cjs.dev.js

@@ -126,3 +126,6 @@ 'use strict';

useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(function () {
var observer;
if (!observe) {
return;
}
var elem = element; // State initializes before refs are placed, meaning the element state will

@@ -143,15 +146,13 @@ // be undefined on the first render. We still want the rect on the first

return cleanup;
return;
}
observer = observeRect__default['default'](elem, function (rect) {
var observer = observeRect__default['default'](elem, function (rect) {
onChangeRef.current == null ? void 0 : onChangeRef.current(rect);
setRect(rect);
});
observe && observer.observe();
return cleanup;
function cleanup() {
observer && observer.unobserve();
}
observer.observe();
return function () {
observer.unobserve();
};
}, [observe, element, nodeRef]);

@@ -158,0 +159,0 @@ return rect;

@@ -100,3 +100,6 @@ 'use strict';

useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(function () {
var observer;
if (!observe) {
return;
}
var elem = element; // State initializes before refs are placed, meaning the element state will

@@ -114,15 +117,13 @@ // be undefined on the first render. We still want the rect on the first

return cleanup;
return;
}
observer = observeRect__default['default'](elem, function (rect) {
var observer = observeRect__default['default'](elem, function (rect) {
onChangeRef.current == null ? void 0 : onChangeRef.current(rect);
setRect(rect);
});
observe && observer.observe();
return cleanup;
function cleanup() {
observer && observer.unobserve();
}
observer.observe();
return function () {
observer.unobserve();
};
}, [observe, element, nodeRef]);

@@ -129,0 +130,0 @@ return rect;

@@ -116,3 +116,6 @@ import { useRef, useEffect, useState } from 'react';

useIsomorphicLayoutEffect(function () {
var observer;
if (!observe) {
return;
}
var elem = element; // State initializes before refs are placed, meaning the element state will

@@ -133,15 +136,13 @@ // be undefined on the first render. We still want the rect on the first

return cleanup;
return;
}
observer = observeRect(elem, function (rect) {
var observer = observeRect(elem, function (rect) {
onChangeRef.current == null ? void 0 : onChangeRef.current(rect);
setRect(rect);
});
observe && observer.observe();
return cleanup;
function cleanup() {
observer && observer.unobserve();
}
observer.observe();
return function () {
observer.unobserve();
};
}, [observe, element, nodeRef]);

@@ -148,0 +149,0 @@ return rect;

{
"name": "@reach/rect",
"version": "0.15.3",
"version": "0.16.0",
"description": "Measure React elements position in the DOM",

@@ -17,3 +17,3 @@ "author": "React Training <hello@reacttraining.com>",

"@reach/observe-rect": "1.2.0",
"@reach/utils": "0.15.3",
"@reach/utils": "0.16.0",
"prop-types": "^15.7.2",

@@ -42,3 +42,3 @@ "tiny-warning": "^1.0.3",

],
"gitHead": "aac3d3e1902ec32656476bcdccd7b56207384fcd"
"gitHead": "e4c6093db14e3cc24c26794a002dbd8c866c0387"
}
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