UNPKG

@fluent-windows/hooks

Version:
19 lines (18 loc) 429 B
/** * Subscribe to focus events based on `onFocus`, `onBlur` * * Demo * import { useFocus } from '@fluent-windows/hooks' * * function handleChange() { * // ... * } * const [status, bind] = useFocus(handleChange) * * <button {...bind}>{status}</button> */ declare function useFocus(statusHandler?: (status: boolean) => void): [boolean, { onFocus: () => void; onBlur: () => void; }]; export default useFocus;