Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rc-resize-observer

react-component7.3mMIT1.4.3TypeScript support: included

Resize observer for React

react, react-component, react-resize-observer, resize-observer

readme

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.

changelog

Changelog

0.5.0

  • support theme="dark|light".

0.4.0

  • support columnLayout.
  • support backgroundColor.

0.3.0

  • support style and className for footer column and footer item.
  • support LinkComponent for footer item.

0.2.0

  • Fix lib and es folders missing.

0.1.0

  • First release.