hightable
Version:
A dynamic windowed scrolling table component for react
15 lines (14 loc) • 436 B
TypeScript
/**
* A hook to get a reference to an HTML element on component mount.
*
* @example
* const { element, onMount } = useHTMLElement<HTMLDivElement>()
*
* return <div ref={onMount}></div>
*
* @returns An object containing the HTML element and a ref callback to be assigned to the element.
*/
export declare function useHTMLElement<T extends HTMLElement>(): {
element: T | null;
onMount: (node: T | null) => () => void;
};