UNPKG

mui-rff

Version:

Set of modern wrapper components to facilitate using Material UI with React Final Form

18 lines (17 loc) 821 B
import 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): 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;