1
1
# Handle element resizes like it's 2024!
2
2
3
- <img src =" https://img.shields.io/npm/dm /react-resize-detector?style=flat-square " > <img src =" https://badgen.net/bundlephobia/minzip /react-resize-detector?style=flat-square " > <img src =" https://badgen.net/bundlephobia/tree-shaking/ react-resize-detector?style=flat-square " >
3
+ <img src =" https://img.shields.io/npm/v /react-resize-detector?style=flat-square " / > <img src =" https://img.shields.io/npm/l /react-resize-detector?style=flat-square " / > <img src =" https://img.shields.io/npm/dm/react-resize-detector?style=flat-square " /> < img src = " https://img.shields.io/bundlejs/size/ react-resize-detector?style=flat-square" / >
4
4
5
5
#### [ Live demo] ( http://maslianok.github.io/react-resize-detector/ )
6
6
@@ -10,11 +10,11 @@ Modern browsers now have native support for detecting element size changes throu
10
10
11
11
🐼 Written in TypeScript
12
12
13
- 🐠 Used by <a href =" https://github.com/maslianok/react-resize-detector/network/dependents " target =" __blank " >160k repositories</a >
13
+ 🐠 Used by <a href =" https://github.com/maslianok/react-resize-detector/network/dependents " target =" __blank " >170k repositories</a >
14
14
15
15
🦄 Produces <a href =" https://npmtrends.com/react-resize-detector " target =" __blank " >100 million downloads annually</a >
16
16
17
- No ` window.resize ` listeners! No timeouts!
17
+ No ` window.resize ` listeners! No timeouts!
18
18
19
19
## Is it necessary for you to use this library?
20
20
@@ -109,7 +109,7 @@ const CustomComponent = () => {
109
109
110
110
| Prop | Type | Description | Default |
111
111
| --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
112
- | onResize | Func | Function that will be invoked with ` width ` and ` height ` arguments | ` undefined ` |
112
+ | onResize | Func | Function that will be invoked with ` width ` , ` height ` and ResizeObserver ` entry ` arguments | ` undefined ` |
113
113
| handleWidth | Bool | Trigger ` onResize ` on width change | ` true ` |
114
114
| handleHeight | Bool | Trigger ` onResize ` on height change | ` true ` |
115
115
| skipOnMount | Bool | Do not trigger onResize when a component mounts | ` false ` |
0 commit comments