![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.
resize-detector
Advanced tools
This project is basically a modified version of sdecima/javascript-detect-element-resize including these changes:
ResizeObserver
first..css
file.$ npm i --save resize-detector
import { addListener, removeListener } from 'resize-detector'
// adding listener
addListener(elem, callback)
// removing listener
removeListener(elem, callback)
this
inside callback
function is the element whose size has been changed.
As resize-detector
is published in both ES Module & CommonJS format and when you use webpack to bundle your app, the ESM version will be imported. It is not transpiled by Babel or similar tools so you have to transpile it in your build process.
For webpack with babe-loader you need to add it to the include
field of the options:
// ...
{
test: /\.js$/,
loader: 'babel-loader',
include: [
// other stuff to be transpiled
// ...
path.resolve('node_modules/resize-detector')
]
}
// ...
If you are using other toolchain, just configure your bundler similarly so that resize-detector
will be transpiled during build process.
Is polyfill?
No.
Native first
Yes.
Strategy
Scroll-based + Mutation-based.
Pros
Side effects
position: static
will become position: relative
.Is polyfill?
No.
Native first
No.
Strategy
Scroll-based.
Pros
<object>
s.Side effects
position: static
will become position: relative
.Limitations
Is polyfill
Yes.
Native first
Yes.
Fallback Strategy
Use MutationObserver
to observe every mutation in a document. For IE9/10, use Mutation Events instead.
Pros
Limitations
:hover
.Is polyfill
No.
Native first
No.
Strategy
Listen to resize
events via hidden <iframe>
s.
Pros
Dead simple.
Side effects
position: static
will become position: relative
.Limitations
Is polyfill?
Yes.
Native first
Yes.
Fallback Strategy
Long polling through requestAnimationFrame
or setTimeout
.
Pros
Dead simple.
Side effects
Is polyfill?
No.
Native first
No.
Strategy
Either hidden <object>
s or scroll-based.
Pros
Two approaches available (Really, why?) with scroll-based approach being much faster than hidden <object>
s.
Side effects
position: static
will become position: relative
.Limitations
0.1.10
FAQs
Element resize detection, both modern way and cross browser.
The npm package resize-detector receives a total of 662 weekly downloads. As such, resize-detector popularity was classified as not popular.
We found that resize-detector 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.