UNPKG

window-table

Version:

Windowing Table for React based on React Window

16 lines (15 loc) 681 B
/** * Detect Element Resize. * https://github.com/sdecima/javascript-detect-element-resize * Sebastian Decima * * Forked from version 0.5.3; includes the following modifications: * 1) Guard against unsafe 'window' and 'document' references (to support SSR). * 2) Defer initialization code via a top-level function wrapper (to support SSR). * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children. * 4) Add nonce for style element. **/ export default function createDetectElementResize(nonce: any): { addResizeListener: (element: any, fn: any) => void; removeResizeListener: (element: any, fn: any) => void; };