@fluent-windows/hooks
Version:
Fluent-Windows React hooks.
19 lines (18 loc) • 429 B
TypeScript
/**
* 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;