@wordpress/components
Version:
UI components for WordPress.
17 lines (14 loc) • 513 B
text/typescript
import { createContext, useContext } from '@wordpress/element';
const RovingTabIndexContext = createContext<
| {
lastFocusedElement: HTMLElement | undefined;
setLastFocusedElement: React.Dispatch<
React.SetStateAction< HTMLElement | undefined >
>;
}
| undefined
>( undefined );
RovingTabIndexContext.displayName = 'RovingTabIndexContext';
export const useRovingTabIndexContext = () =>
useContext( RovingTabIndexContext );
export const RovingTabIndexProvider = RovingTabIndexContext.Provider;