$ npm install rc-resize-observer
Resize observer for React.
https://react-component.github.io/resize-observer/
import ResizeObserver from 'rc-resize-observer';
import { render } from 'react-dom';
render(
<ResizeObserver
onResize={() => {
console.log('resized!');
}}
>
<textarea />
</ResizeObserver>,
mountNode,
);
Property | Type | Default | Description |
---|---|---|---|
disabled | boolean | false | |
onResize | ({ width, height }) => void | - | Trigger when child node resized |
npm install
npm start
rc-resize-observer is released under the MIT license.
© 2010 - cnpmjs.org x YWFE | Home | YWFE