react-resize-detector
- Version 12.3.0
- Published
- 41.1 kB
- 1 dependency
- MIT license
Install
npm i react-resize-detectoryarn add react-resize-detectorpnpm add react-resize-detectorOverview
React resize detector
Index
Functions
function useResizeDetector
useResizeDetector: <T extends HTMLElement = any>({ skipOnMount, refreshMode, refreshRate, refreshOptions, handleWidth, handleHeight, targetRef, observerOptions, onResize, disableRerender,}?: useResizeDetectorProps<T>) => UseResizeDetectorReturn<T>;Interfaces
interface useResizeDetectorProps
interface useResizeDetectorProps<T extends HTMLElement> extends Props {}property targetRef
targetRef?: MutableRefObject<T | null>;interface UseResizeDetectorReturn
interface UseResizeDetectorReturn<T> extends Dimensions {}property ref
ref: OnRefChangeType<T>;Type Aliases
type Dimensions
type Dimensions = { height?: number; width?: number;};type OnResizeCallback
type OnResizeCallback = (payload: ResizePayload) => void;type RefreshModeType
type RefreshModeType = 'throttle' | 'debounce';type RefreshOptionsType
type RefreshOptionsType = { leading?: boolean; trailing?: boolean;};type ResizePayload
type ResizePayload = | { width: number; height: number; entry: ResizeObserverEntry; } | { width: null; height: null; entry: null; };If element is mounted, returns its dimensions and
ResizeObserverEntryIf element is unmounted, returns null
Package Files (3)
Dependencies (1)
Dev Dependencies (15)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-resize-detector.
- Markdown[](https://www.jsdocs.io/package/react-resize-detector)
- HTML<a href="https://www.jsdocs.io/package/react-resize-detector"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3192 ms. - Missing or incorrect documentation? Open an issue for this package.
