UNPKG

@wordpress/compose

Version:
23 lines 662 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 '@wordpress/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