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