react-resize-element
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

React Resize Element

It detects the size change of an element not only when windows resize but with really all changes in the size of the element.

Low performance resize event listener as React element based on Element Resize Event Listener.

Include types for TypeScript and Flow.

Props

  • tag string default "div"
  • style React.CSSProperties
  • notSendInitialSize boolean default false
  • onResize (size: Size) => void
  • children React.ReactNode

Example

import ResizeElement from "react-resize-element";

...
render() {
    return <ResizeElement onResize={({ width, height }) => handleResize(width, height)} >
        ...
    </ResizeElement>;
}
...

Package Sidebar

Install

npm i react-resize-element

Weekly Downloads

10

Version

1.0.0

License

MIT

Unpacked Size

6.97 kB

Total Files

8

Last publish

Collaborators

  • ing-fenix