@acusti/use-is-out-of-bounds
Version:
React hook that detects if an element is outside of its parent’s bounds on any of its sides (like collision detection)
20 lines (18 loc) • 491 B
Flow
/**
* Flowtype definitions for useIsOutOfBounds
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.20.1
* @flow
*/
declare type MaybeHTMLElement = HTMLElement | null;
declare type OutOfBounds = {|
bottom: boolean,
hasLayout: boolean,
left: boolean,
maxHeight: null | number,
maxWidth: null | number,
right: boolean,
top: boolean,
|};
declare var useIsOutOfBounds: (element?: MaybeHTMLElement) => OutOfBounds;
declare export default typeof useIsOutOfBounds;