rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
22 lines • 999 B
TypeScript
import { DOMAttributes } from "@react-types/shared";
import React from "react";
interface FocusWithinProps {
/** Handler that is called when the target element or a descendant receives focus. */
onFocusWithin?: (e: React.FocusEvent) => void;
/** Handler that is called when the target element and all descendants lose focus. */
onBlurWithin?: (e: React.FocusEvent) => void;
/** Handler that is called when the the focus within state changes. */
onFocusWithinChange?: (isFocusWithin: boolean) => void;
}
interface FocusWithinResult<T> {
/** Props to spread onto the target element. */
focusWithinProps: DOMAttributes<T>;
}
/**
* useFocusWithin
* @description Handles focus events for the target component.
* @see {@link https://react-hooks.org/docs/useFocusWithin}
*/
declare const useFocusWithin: <T extends HTMLElement>(props: FocusWithinProps) => FocusWithinResult<T>;
export { useFocusWithin };
//# sourceMappingURL=useFocusWithin.d.ts.map