ant-design/components/form/hooks/useFormInstance.ts
Tom Xu 1719748a29
chore: eslint add consistent-type-imports (#35419)
* chore: eslint add consistent-type-imports

* fix avatar

* Update Item.tsx
2022-05-07 14:31:54 +08:00

10 lines
267 B
TypeScript

import { useContext } from 'react';
import { FormContext } from '../context';
import type { FormInstance } from './useForm';
export default function useFormInstance<Value = any>(): FormInstance<Value> {
const { form } = useContext(FormContext);
return form!;
}