Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow React 18 as peerDependency #206

Closed
snelsi opened this issue Apr 15, 2022 · 10 comments
Closed

Allow React 18 as peerDependency #206

snelsi opened this issue Apr 15, 2022 · 10 comments

Comments

@snelsi
Copy link
Collaborator

snelsi commented Apr 15, 2022

React 18 is backward compatible, please, allow React version ^18.0 as peerDependency in package.json
https://reactjs.org/blog/2022/03/29/react-v18.html

@theniceboy
Copy link

# Handle element resizes like it's 2022!

Support React 18 like it's 2022! 😄

Btw thank you for this package! This is awesome!

@michaelbull
Copy link

michaelbull commented Apr 30, 2022

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.

@AntonOfTheWoods
Copy link

Handle element resizes like it's 2022!... Handle element resizes like it's H2 2022!?

maslianok added a commit that referenced this issue May 25, 2022
@maslianok
Copy link
Owner

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.

@maslianok
Copy link
Owner

Published in v7.0.1

@maslianok
Copy link
Owner

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.

#209 is merged too. published v7.0.2

@ddkang
Copy link
Collaborator

ddkang commented May 25, 2022

Thank you so much! Stay safe

@k-funk
Copy link

k-funk commented Mar 29, 2024

@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.

@snelsi
Copy link
Collaborator Author

snelsi commented Mar 30, 2024

@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
  1. Import the .global version of the polyfill at the top of your boot file:
import 'resize-observer-polyfill/dist/ResizeObserver.global'
  1. 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
Copy link

k-funk commented Mar 30, 2024

@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
  1. Import the .global version of the polyfill at the top of your boot file:
import 'resize-observer-polyfill/dist/ResizeObserver.global'
  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants