antd-v4-compatible-form
Version:
antd@4.x form,用于 antd@3.x
18 lines (17 loc) • 811 B
TypeScript
import * as React from 'react';
import { FormInstance as RcFormInstance } from 'rc-field-form';
declare type InternalNamePath = (string | number)[];
/**
* Always debounce error to avoid [error -> null -> error] blink
*/
export declare function useCacheErrors(errors: React.ReactNode[], changeTrigger: (visible: boolean) => void): [boolean, React.ReactNode[]];
export declare function toArray<T>(candidate?: T | T[] | false): T[];
export declare function getFieldId(namePath: InternalNamePath, formName?: string): string | undefined;
export interface FormInstance extends RcFormInstance {
scrollToField: (name: string | number | InternalNamePath) => void;
__INTERNAL__: {
name?: string;
};
}
export declare function useForm(form?: FormInstance): [FormInstance];
export {};