![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
add-resize-listener
Advanced tools
A Cross-Browser, Event-based, Element Resize Detection.
In short, this implementation does NOT use an internal timer to detect size changes (as most implementations I found do).
It uses scroll
events on most browsers, and the onresize
event on IE10 and below.
The method used not only detects javascript generated resize changes but also changes made from CSS pseudo classes e.g. :hover, CSS animations, etc.
I was searching for a library that allowed me to detect when an DOM element changes size, and all solutions I found had two problems:
Then I came across this great post on Back Alley Coder about using overflow and underflow events scroll
events to do event-based element resize detection; and it works great without consuming resources at all (just like any other browser originated event).
The libraries on this repository are just a ready-to-use implementation of the above, one pure javascript and the other a jQuery plugin version (just for convenience).
This fork packages it as a common.js module.
Install:
npm install --save add-resize-listener
Usage:
const addResizeListener = require('add-resize-listener');
const unsub = addResizeListener(element, () => {
console.log(`Resized`);
});
unsub();
// alternative, uglier
const addResizeListener = require('add-resize-listener');
const { removeResizeListener } = addResizeListener;
const handler = () => {
console.log(`Resized`);
}
addResizeListener(element, handler);
removeResizeListener(element, handler);
Works great on:
Known Issues:
Doesn't work on:
Please let me know if you test these libraries on any other browser, of if you run into issues with any of the above browsers.
Don't get me wrong, these are great libraries and work as advertised, it's just that they are not easy on browser resources.
Back Alley Coder: Cross-Browser, Event-based, Element Resize Detection
Back Alley Coder: Overflow and Underflow Events
FAQs
A Cross-Browser, Event-based, Element Resize Detection
The npm package add-resize-listener receives a total of 10 weekly downloads. As such, add-resize-listener popularity was classified as not popular.
We found that add-resize-listener 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.