import ListItem from '@mui/material/ListItem'; import FormHelperText from '@mui/material/FormHelperText'; import List from '@mui/material/List'; import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; /** The `FieldErrorTemplate` component renders the errors local to the particular field * * @param props - The `FieldErrorProps` for the errors being rendered */ export default function FieldErrorTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >(props: FieldErrorProps) { const { errors = [], fieldPathId } = props; if (errors.length === 0) { return null; } const id = errorId(fieldPathId); return ( {errors.map((error, i: number) => { return ( {error} ); })} ); }