UNPKG

@datalayer/core

Version:
10 lines (9 loc) 514 B
import { type RefObject } from 'react'; /** * Determine if a child element of the provided ref is currently focussed. * @param containerRef The ref to the container element. * @param onFocusChange The callback to be called when the focus state changes. * @type T The type of the container element. * @returns The ref to be applied to the container element. */ export declare const useContainsFocus: <T extends HTMLElement>(containerRef?: RefObject<T>, onFocusChange?: (isFocussed: boolean) => void) => void;