Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-dom-resize-observer
Advanced tools
Readme
Hook to provide a performant mechanism by which code can monitor an element for changes to its size, with notifications being delivered to the observer each time the size changes.
$ npm install react-dom-resize-observer
export function App() {
const {
// New dimensions when resize is observed.
entry,
// Callback to pass as a ref to give this hook access to the DOM element.
observer,
// Callback to disconnect observing completely.
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>({
// You can optionally pass your own ref if you already have one.
elementRef: ref,
// You can optionally pass a callback to access the raw DOM element on resize.
onResize: (el) => { /** Access the element on resize... */ },
});
return (
// Attach the observer as a ref to the DOM.
<div ref={observer} onClick={disconnect}>
App
</div>
)
}
FAQs
React hook implementing the Resize Observer API.
The npm package react-dom-resize-observer receives a total of 1 weekly downloads. As such, react-dom-resize-observer popularity was classified as not popular.
We found that react-dom-resize-observer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.