@lidakai/rc-resize-observer

1.2.4 • Public • Published

rc-resize-observer

NPM version dumi build status Codecov david deps david devDeps 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.

Package Sidebar

Install

npm i @lidakai/rc-resize-observer

Weekly Downloads

7

Version

1.2.4

License

MIT

Unpacked Size

35.2 kB

Total Files

26

Last publish

Collaborators

  • nianyi_778
  • yanjintan