@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
10 lines (9 loc) • 514 B
TypeScript
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;