@patternfly/react-core
Version:
This library provides a set of common React components for use with the PatternFly reference implementation.
33 lines (29 loc) • 884 B
text/typescript
import { createContext } from 'react';
export interface TabsContextProps {
variant: 'default' | 'secondary';
mountOnEnter: boolean;
unmountOnExit: boolean;
localActiveKey: string | number;
uniqueId: string;
handleTabClick: (
event: React.MouseEvent<HTMLElement, MouseEvent>,
eventKey: number | string,
tabContentRef: React.RefObject<any>
) => void;
handleTabClose?: (
event: React.MouseEvent<HTMLElement, MouseEvent>,
eventKey: number | string,
tabContentRef?: React.RefObject<any>
) => void;
}
export const TabsContext = createContext<TabsContextProps>({
variant: 'default',
mountOnEnter: false,
unmountOnExit: false,
localActiveKey: '',
uniqueId: '',
handleTabClick: () => null,
handleTabClose: undefined
});
export const TabsContextProvider = TabsContext.Provider;
export const TabsContextConsumer = TabsContext.Consumer;