Package Exports
- @reach/observe-rect
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@reach/observe-rect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Observe the rect of a DOM element.
Installation
npm install @reach/observe-rect
# or
yarn add @reach/observe-rect
Usage
import observeRect from "@reach/observe-rect";
let node = document.getElementById("some-node");
let rectObserver = observeRect(node, rect => {
rect.left;
rect.top;
rect.height;
rect.width;
});
About
A lot of things can change the position or size of an element, like scrolling, content reflows and user input. This utility observes and notifies you when your element's rect changes.
Legal
MIT License Copyright (c) 2018-present, Ryan Florence