https://github.com/react-component/resize-observer
👓 Resize observer for React
https://github.com/react-component/resize-observer
ant-design antd react react-component
Last synced: 4 months ago
JSON representation
👓 Resize observer for React
- Host: GitHub
- URL: https://github.com/react-component/resize-observer
- Owner: react-component
- License: mit
- Created: 2019-09-29T04:17:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-19T14:36:52.000Z (7 months ago)
- Last Synced: 2025-08-16T05:35:10.243Z (4 months ago)
- Topics: ant-design, antd, react, react-component
- Language: JavaScript
- Homepage: https://resize-observer.react-component.now.sh
- Size: 4.59 MB
- Stars: 189
- Watchers: 4
- Forks: 45
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rc-resize-observer
[![NPM version][npm-image]][npm-url] [](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/rc-resize-observer.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-resize-observer
[github-actions-image]: https://github.com/react-component/resize-observer/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/resize-observer/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/resize-observer/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/resize-observer/branch/master
[download-image]: https://img.shields.io/npm/dm/rc-resize-observer.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-resize-observer
Resize observer for React.
## Live Demo
https://resize-observer-react-component.vercel.app/
## Install
[](https://npmjs.org/package/rc-resize-observer)
## Usage
```js
import ResizeObserver from 'rc-resize-observer';
import { render } from 'react-dom';
render(
{
console.log('resized!');
}}
>
,
mountNode,
);
```
## API
| Property | Type | Default | Description |
| -------- | --------------------------- | ------- | ------------------------------- |
| disabled | boolean | false | |
| onResize | ({ width, height }) => void | - | Trigger when child node resized |
## Development
```
npm install
npm start
```
## License
rc-resize-observer is released under the MIT license.