useElementByPoint
A React Hook that returns the element at a given point.
Demo
Source Selected Element: <undefined />
Pause Resume
Usage
See API for more details.
Source
Click links below to view source on GitHub.
API
const { isSupported , element , ... controls } = useElementByPoint ( options )
Options
export type UseElementByPointOptions < M extends boolean = false > = Position & {
/**
* Whether to return multiple elements
*
* @defaultValue false
*/
multiple ? : M
/**
* Whether to execute immediately
*
* @defaultValue true
*/
immediate ? : boolean
/**
* The interval to execute
*
* @defaultValue 'requestAnimationFrame'
*/
interval ? : 'requestAnimationFrame' | number
}
Returns
Retuerns contain Pausable instance that can be paused, resumed.
See Pausable for more details.
export type UseElementByPointReturns < E extends Element | null | Element []> = Pausable & {
/**
* Whether the browser supports the API
*/
isSupported : boolean
/**
* The element at the specified position
*/
element : E
}