UNPKG

@wordpress/components

Version:
17 lines (14 loc) • 513 B
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;