@reach/rect
Advanced tools
Comparing version 0.7.4 to 0.8.0
@@ -39,5 +39,5 @@ 'use strict'; | ||
}; | ||
Rect.displayName = "Rect"; | ||
{ | ||
Rect.displayName = "Rect"; | ||
Rect.propTypes = { | ||
@@ -44,0 +44,0 @@ children: PropTypes.func.isRequired, |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");require("prop-types");var r,t=(r=require("@reach/observe-rect"))&&"object"==typeof r&&"default"in r?r.default:r,u=function(r){var t=r.onChange,u=r.observe,c=void 0===u||u,o=r.children,s=e.useRef(null);return o({ref:s,rect:n(s,c,t)})};function n(r,u,n){void 0===u&&(u=!0);var c=e.useRef(!1),o=e.useState(null),s=o[0],a=o[1],f=e.useRef(null);return e.useLayoutEffect((function(){var e=function(){f.current&&f.current.unobserve()};return r.current?(f.current||(f.current=t(r.current,(function(e){n&&n(e),a(e)}))),c.current||(c.current=!0,a(r.current.getBoundingClientRect())),u&&f.current.observe(),e):(console.warn("You need to place the ref"),e)}),[u,n]),s}u.displayName="Rect",exports.Rect=u,exports.default=u,exports.useRect=n; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");require("prop-types");var r,t=(r=require("@reach/observe-rect"))&&"object"==typeof r&&"default"in r?r.default:r,u=function(r){var t=r.onChange,u=r.observe,c=void 0===u||u,o=r.children,s=e.useRef(null);return o({ref:s,rect:n(s,c,t)})};function n(r,u,n){void 0===u&&(u=!0);var c=e.useRef(!1),o=e.useState(null),s=o[0],f=o[1],a=e.useRef(null);return e.useLayoutEffect((function(){var e=function(){a.current&&a.current.unobserve()};return r.current?(a.current||(a.current=t(r.current,(function(e){n&&n(e),f(e)}))),c.current||(c.current=!0,f(r.current.getBoundingClientRect())),u&&a.current.observe(),e):(console.warn("You need to place the ref"),e)}),[u,n]),s}exports.Rect=u,exports.default=u,exports.useRect=n; | ||
//# sourceMappingURL=rect.cjs.production.min.js.map |
@@ -33,5 +33,5 @@ import { useRef, useState, useLayoutEffect } from 'react'; | ||
}; | ||
Rect.displayName = "Rect"; | ||
if (process.env.NODE_ENV !== "production") { | ||
Rect.displayName = "Rect"; | ||
Rect.propTypes = { | ||
@@ -38,0 +38,0 @@ children: PropTypes.func.isRequired, |
{ | ||
"name": "@reach/rect", | ||
"version": "0.7.4", | ||
"version": "0.8.0", | ||
"description": "Measure React elements position in the DOM", | ||
@@ -32,3 +32,3 @@ "author": "React Training <hello@reacttraining.com>", | ||
], | ||
"gitHead": "f460709e283a60dd5ea62952b7feaf88546a50ff" | ||
"gitHead": "7702c46373c7f11adc21184e7def9977203e9326" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
28006