You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/packages/meta-form/src/context.tsx

14 lines
390 B
TypeScript

import React, { useContext } from 'react';
import type { useFormik } from 'formik';
type MetaFormContextType = ReturnType<typeof useFormik>;
export const MetaFormContext = React.createContext<MetaFormContextType | null>(
null
);
MetaFormContext.displayName = 'MetaFormContext';
export function useMetaFormContext(): MetaFormContextType | null {
return useContext(MetaFormContext);
}