react-resize-detector
Version:
React resize detector
11 lines (10 loc) • 499 B
TypeScript
import { MutableRefObject } from 'react';
import { Props, ReactResizeDetectorDimensions } from './ResizeDetector';
interface returnType<RefType> extends ReactResizeDetectorDimensions {
ref: MutableRefObject<null | RefType>;
}
interface FunctionProps<RefType> extends Props {
targetRef?: MutableRefObject<null | RefType>;
}
declare function useResizeDetector<RefType extends Element = Element>(props?: FunctionProps<RefType>): returnType<RefType>;
export default useResizeDetector;