Element resize sensor with optional debounce
Element resize sensor with optional debounce



``sh`
npm install --save react react-element-resize
Don't forget to manually install peer dependencies (react) if you use npm@3.
`htmlReactElementResize
(Module exposed as )`
http://nkbt.github.io/react-element-resize
https://codepen.io/nkbt/pen/RVYWQm
js
import React from 'react';
import ReactDOM from 'react-dom';
import {ReactElementResize} from 'react-element-resize';
const onResize = ({width, height}) =>
console.log({width, height});
const onScroll = ({offsetLeft, offsetTop, scrollLeft, scrollTop}) =>
console.log({offsetLeft, offsetTop, scrollLeft, scrollTop});
const App = () => (
{data => {JSON.stringify(data, null, 2)}}
);
const appRoot = document.createElement('div');
document.body.appendChild(appRoot);
ReactDOM.render( , appRoot);
`Options
`js
// TODO
``MIT