UNPKG

@gechiui/compose

Version:
23 lines 660 B
/** * Hook used to focus the first tabbable element on mount. * * @param {boolean | 'firstElement'} focusOnMount Focus on mount mode. * @return {import('react').RefCallback<HTMLElement>} Ref callback. * * @example * ```js * import { useFocusOnMount } from '@gechiui/compose'; * * const WithFocusOnMount = () => { * const ref = useFocusOnMount() * return ( * <div ref={ ref }> * <Button /> * <Button /> * </div> * ); * } * ``` */ export default function useFocusOnMount(focusOnMount?: boolean | 'firstElement'): import('react').RefCallback<HTMLElement>; //# sourceMappingURL=index.d.ts.map