Closed snelsi closed 2 years ago
Support React 18 like it's 2022! 😄
Btw thank you for this package! This is awesome!
React 18 is backward compatible
It isn't. Issue #208 highlights a major regression that needs addressing first, the solution for which is in PR #209.
It won't work out-of-the-box in React 18 until this is addressed.
Handle element resizes like it's 2022!
... Handle element resizes like it's H2 2022!
?
Thank you, guys. We have a complex situation here in Ukraine, so I'm a bit off from my OS projects. Hope you understand and continue using this library.
Published in v7.0.1
React 18 is backward compatible
It isn't. Issue #208 highlights a major regression that needs addressing first, the solution for which is in PR #209.
It won't work out-of-the-box in React 18 until this is addressed.
Thank you so much! Stay safe
@maslianok
is it possible to get the change
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
},
in v6.x as well? my team's project isn't yet ready to drop 2020 browser support.
@k-funk
There's no need to stay on v6
.
You can upgrade to the latest version of react-resize-detector
and add a polyfill for ResizeObserver
yourself.
v6
uses resize-observer-polyfill library.
Here's how you can achieve the same behavior:
1) Install the polyfill:
npm install resize-observer-polyfill --save-dev
2) Import the .global
version of the polyfill at the top of your boot file:
import 'resize-observer-polyfill/dist/ResizeObserver.global'
3) Alternatively, you can import the ponyfill and attach it to the global window
object at the top of your boot file like this:
import ResizeObserver from "resize-observer-polyfill"
window.ResizeObserver = ResizeObserver;
@k-funk There's no need to stay on
v6
. You can upgrade to the latest version ofreact-resize-detector
and add a polyfill forResizeObserver
yourself.
v6
uses resize-observer-polyfill library. Here's how you can achieve the same behavior:
- Install the polyfill:
npm install resize-observer-polyfill --save-dev
- Import the
.global
version of the polyfill at the top of your boot file:import 'resize-observer-polyfill/dist/ResizeObserver.global'
- Alternatively, you can import the ponyfill and attach it to the global
window
object at the top of your boot file like this:import ResizeObserver from "resize-observer-polyfill" window.ResizeObserver = ResizeObserver;
Fantastic, thank you!
Might be worth adding this to the README for others to find.
React 18 is backward compatible, please, allow React version
^18.0
as peerDependency inpackage.json
https://reactjs.org/blog/2022/03/29/react-v18.html