You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is the API is used to determine if an element is resized. Browser support is pretty good in Chrome, but is still missing support in other major browsers.
32
+
If it is present, this library uses the recent [`ResizeObserver` browser
33
+
API](https://developers.google.com/web/updates/2016/10/resizeobserver) to
34
+
determine if an element's content size has changed.
35
+
36
+
If a browser does not have the `ResizeObserver` API present, then this library
37
+
falls back to listening on window size changes, which is less efficient and does
38
+
not listen for changes to the component's size due to other factors like content
39
+
changes. If it is not present, you can use pass a `ResizeObserver`
40
+
implementation into the `useComponentSize()` hook (see below).
41
+
42
+
Browser support is pretty good in Chrome, but is still missing support in other
43
+
major browsers.
34
44
35
45
> [Can i use ResizeObserver?](https://caniuse.com/#feat=resizeobserver)
36
46
37
47
### Polyfill
38
48
39
-
You can import the
40
-
[polyfill](https://github.com/que-etc/resize-observer-polyfill) directly from here
49
+
You can import [a ResizeObserver
50
+
ponyfill](https://github.com/que-etc/resize-observer-polyfill) with this NPM
0 commit comments