UNPKG

@wordpress/components

Version:
20 lines (17 loc) 547 B
/** * WordPress dependencies */ 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;