ant-design/components/form/hooks/useFormInstance.ts
二货机器人 beeaf2d221
docs: More info about useWatch (#35039)
* docs: more about useWatch

* test: Update test case

* docs: more info

* docs: more & more

* feat: add useFormInstance

* chore: add version info
2022-04-15 15:51:09 +08:00

10 lines
262 B
TypeScript

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