Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

A React component that allows you to use a ResizeObserver to measure an element's size.

License

Notifications You must be signed in to change notification settings

ZeeCoder/react-resize-observer

Repository files navigation

@zeecoder/react-resize-observer

A React component that allows you to use a ResizeObserver to measure an element's size.

npm version build

Install

yarn add @zeecoder/react-resize-observer
# or
npm install --save @zeecoder/react-resize-observer

Usage

const App = () => (
  <ResizeObserver>
    {(ref, width, height) => (
      <div ref={ref}>
        My size is {width}x{height}
      </div>
    )}
  </ResizeObserver>
);

Notes

Related

License

MIT

About

A React component that allows you to use a ResizeObserver to measure an element's size.

Resources

License

Stars

Watchers

Forks

Packages

No packages published