Skip to content

ingSlonik/react-resize-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>;
}
...

About

Low performance react resize element.

Resources

License

Stars

Watchers

Forks

Packages

No packages published