ZeeCoder / react-resize-observer

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

Repository from Github https://github.comZeeCoder/react-resize-observerRepository from Github https://github.comZeeCoder/react-resize-observer

@zeecoder/react-resize-observer

This package is now officially deprecated.
Use the use-resize-observer hook instead.

If you want the old API, then create a react component, like so:

import useResizeObserver from "use-resize-observer";

export default function({ children }) {
  const { ref, width, height } = useResizeObserver();

  return children(ref, width, height);
}

Alternatively, see the last readme for v2 here.

About

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

License:MIT License


Languages

Language:JavaScript 100.0%