mui-rff
Version:
Set of modern wrapper components to facilitate using Material UI with React Final Form
20 lines (19 loc) • 913 B
TypeScript
import { FormHelperTextProps } from '@mui/material';
import { default as React } from 'react';
import { FieldRenderProps } from 'react-final-form';
type FieldMetaState<FieldValue> = FieldRenderProps<FieldValue>['meta'];
export interface ErrorMessageProps {
formHelperTextProps?: Partial<FormHelperTextProps>;
helperText?: React.ReactNode;
meta: FieldMetaState<any>;
showError: boolean;
}
export declare function ErrorMessage({ showError, meta, formHelperTextProps, helperText, }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element | null;
export type ShowErrorFunc = (props: ShowErrorProps) => boolean;
export interface ShowErrorProps {
meta: FieldMetaState<any>;
}
export declare const useFieldForErrors: (name: string) => FieldRenderProps<any, HTMLElement, any>;
export declare const showErrorOnChange: ShowErrorFunc;
export declare const showErrorOnBlur: ShowErrorFunc;
export {};