@reach/rect
Advanced tools
Comparing version 0.15.0 to 0.15.2
@@ -110,6 +110,3 @@ 'use strict'; | ||
var onChangeRef = React.useRef(onChange); | ||
var stableOnChange = React.useCallback(function (rect) { | ||
onChangeRef.current && onChangeRef.current(rect); | ||
}, []); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
var onChangeRef = React.useRef(onChange); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
@@ -150,3 +147,3 @@ useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(function () { | ||
observer = observeRect__default['default'](elem, function (rect) { | ||
stableOnChange(rect); | ||
onChangeRef.current == null ? void 0 : onChangeRef.current(rect); | ||
setRect(rect); | ||
@@ -160,3 +157,3 @@ }); | ||
} | ||
}, [observe, element, nodeRef, stableOnChange]); | ||
}, [observe, element, nodeRef]); | ||
return rect; | ||
@@ -163,0 +160,0 @@ } |
@@ -84,6 +84,3 @@ 'use strict'; | ||
var onChangeRef = React.useRef(onChange); | ||
var stableOnChange = React.useCallback(function (rect) { | ||
onChangeRef.current && onChangeRef.current(rect); | ||
}, []); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
var onChangeRef = React.useRef(onChange); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
@@ -121,3 +118,3 @@ useIsomorphicLayoutEffect.useIsomorphicLayoutEffect(function () { | ||
observer = observeRect__default['default'](elem, function (rect) { | ||
stableOnChange(rect); | ||
onChangeRef.current == null ? void 0 : onChangeRef.current(rect); | ||
setRect(rect); | ||
@@ -131,3 +128,3 @@ }); | ||
} | ||
}, [observe, element, nodeRef, stableOnChange]); | ||
}, [observe, element, nodeRef]); | ||
return rect; | ||
@@ -134,0 +131,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { useRef, useEffect, useState, useCallback } from 'react'; | ||
import { useRef, useEffect, useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -100,6 +100,3 @@ import observeRect from '@reach/observe-rect'; | ||
var onChangeRef = useRef(onChange); | ||
var stableOnChange = useCallback(function (rect) { | ||
onChangeRef.current && onChangeRef.current(rect); | ||
}, []); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
var onChangeRef = useRef(onChange); // eslint-disable-next-line react-hooks/exhaustive-deps | ||
@@ -140,3 +137,3 @@ useIsomorphicLayoutEffect(function () { | ||
observer = observeRect(elem, function (rect) { | ||
stableOnChange(rect); | ||
onChangeRef.current == null ? void 0 : onChangeRef.current(rect); | ||
setRect(rect); | ||
@@ -150,3 +147,3 @@ }); | ||
} | ||
}, [observe, element, nodeRef, stableOnChange]); | ||
}, [observe, element, nodeRef]); | ||
return rect; | ||
@@ -153,0 +150,0 @@ } |
{ | ||
"name": "@reach/rect", | ||
"version": "0.15.0", | ||
"version": "0.15.2", | ||
"description": "Measure React elements position in the DOM", | ||
@@ -17,6 +17,6 @@ "author": "React Training <hello@reacttraining.com>", | ||
"@reach/observe-rect": "1.2.0", | ||
"@reach/utils": "0.15.0", | ||
"@reach/utils": "0.15.2", | ||
"prop-types": "^15.7.2", | ||
"tiny-warning": "^1.0.3", | ||
"tslib": "^2.1.0" | ||
"tslib": "^2.3.0" | ||
}, | ||
@@ -42,3 +42,3 @@ "devDependencies": { | ||
], | ||
"gitHead": "1449650359c119c1afe25973aa7584e09e2c88bc" | ||
"gitHead": "353f409a296a648c4fe2c2d06b14a39b7b6dc3e1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19882
453
+ Added@reach/utils@0.15.2(transitive)
- Removed@reach/utils@0.15.0(transitive)
Updated@reach/utils@0.15.2
Updatedtslib@^2.3.0