import React, { useCallback, useState } from 'react' const StepContext = React.createContext({ step: 0, setStep: (step: number) => {}, resetStep: () => {} }) interface IAppProps { children: React.ReactNode } const StepContextProvider: React.FunctionComponent = (props) => { const { children } = props const [step, setStep] = useState(0) const resetStep = useCallback(() => { setStep(0) }, []) return {children} } export { StepContextProvider, StepContext }