rc-resize-observer
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

rc-resize-observer

NPM version dumi build status Codecov npm download

Resize observer for React.

Live Demo

https://react-component.github.io/resize-observer/

Install

rc-resize-observer

Usage

import ResizeObserver from 'rc-resize-observer';
import { render } from 'react-dom';

render(
  <ResizeObserver
    onResize={() => {
      console.log('resized!');
    }}
  >
    <textarea />
  </ResizeObserver>,
  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.

Dependencies (4)

Dev Dependencies (24)

Package Sidebar

Install

npm i rc-resize-observer

Weekly Downloads

1,364,645

Version

1.4.0

License

MIT

Unpacked Size

36.5 kB

Total Files

25

Last publish

Collaborators

  • afc163
  • zombiej