react-resize-element
v1.0.0
Published
Low performance react resize element.
Downloads
40
Maintainers
Readme
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>;
}
...