use-element-resize
Version:
Detect element resize with hooks
12 lines (11 loc) • 316 B
TypeScript
export declare const noop: () => void;
export declare type State = {
width: number;
height: number;
running: boolean;
};
export declare type ObserverProps = {
id: string;
onResize?: (args: Pick<State, "width" | "height">) => void;
onExit?: (args: Pick<State, "width" | "height">) => void;
};