Giter VIP home page Giter VIP logo

Comments (10)

theniceboy avatar theniceboy commented on June 12, 2024 6

# Handle element resizes like it's 2022!

Support React 18 like it's 2022! 😄

Btw thank you for this package! This is awesome!

from react-resize-detector.

michaelbull avatar michaelbull commented on June 12, 2024 3

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.

from react-resize-detector.

maslianok avatar maslianok commented on June 12, 2024 2

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.

from react-resize-detector.

snelsi avatar snelsi commented on June 12, 2024 2

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

from react-resize-detector.

k-funk avatar k-funk commented on June 12, 2024 1

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

from react-resize-detector.

AntonOfTheWoods avatar AntonOfTheWoods commented on June 12, 2024

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

from react-resize-detector.

maslianok avatar maslianok commented on June 12, 2024

Published in v7.0.1

from react-resize-detector.

maslianok avatar maslianok commented on June 12, 2024

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

from react-resize-detector.

ddkang avatar ddkang commented on June 12, 2024

Thank you so much! Stay safe

from react-resize-detector.

k-funk avatar k-funk commented on June 12, 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.

from react-resize-detector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.