import React, { FC, useContext } from 'react'; import { FieldValues, UseFormReturn } from 'react-hook-form'; import { Question } from '../../../__generated__/graphql-schema'; type FormContextProps = { hooks: UseFormReturn question?: Question } const FormContext = React.createContext(null); export const useFormProvider = () => { const context = useContext(FormContext) if (context === null) { throw new Error('You probably forgot to put .') } return context } type Props = { children?: any props: FormContextProps } export const FormProvider: FC = ({ children, props }) => { return ( {children} ) }