@mirawision/reactive-hooks
Version:
A comprehensive collection of 50+ React hooks for state management, UI interactions, device APIs, async operations, drag & drop, audio/speech, and more. Full TypeScript support with SSR safety.
8 lines (7 loc) • 310 B
TypeScript
import { RefObject } from 'react';
/**
* A hook that tracks whether an HTML element has focus.
* @param ref React ref object for the element to monitor
* @returns boolean indicating if the element is currently focused
*/
export declare function useFocus<T extends HTMLElement>(ref: RefObject<T>): boolean;