on-el-resize - on HTML element resize event helper
on-el-resize
is a simple helper which provides an API for attaching resize event firing to HTML elements.
This can simplify creation of some dynamic and responsive components which styles and structure depend on absolute width and height values.
Install
npm install on-el-resize # or yarn add on-el-resize
Usage
TypeScript / JavaScript
; ;; ; // Attach eventresize.addResizeListenerelement, resizeHandler; // Detach eventresize.removeResizeListenerelement, resizeHandler;
React component sample
;;
React declarative approach
Component is in draft status
; ;