@wordpress/compose
Version:
WordPress higher-order components (HOCs).
23 lines • 662 B
TypeScript
/**
* 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