UNPKG

@patternfly/react-core

Version:

This library provides a set of common React components for use with the PatternFly reference implementation.

24 lines (20 loc) 654 B
import { createContext } from 'react'; import { WizardStep } from './Wizard'; export interface WizardContextType { goToStepById: (stepId: number | string) => void; goToStepByName: (stepName: string) => void; onNext: () => void; onBack: () => void; onClose: () => void; activeStep: WizardStep; } export const WizardContext = createContext<WizardContextType>({ goToStepById: () => null, goToStepByName: () => null, onNext: () => null, onBack: () => null, onClose: () => null, activeStep: { name: null } }); export const WizardContextProvider = WizardContext.Provider; export const WizardContextConsumer = WizardContext.Consumer;