Skip to content

Commit 2b79979

Browse files
committed
Pass errorSchema from ArrayField to ArrayFieldTemplate
1 parent e2e37b7 commit 2b79979

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

packages/core/src/components/fields/ArrayField.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ class ArrayField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends For
787787
uiSchema,
788788
title: fieldTitle,
789789
formContext,
790+
errorSchema,
790791
rawErrors,
791792
};
792793

packages/docs/docs/advanced-customization/custom-templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ The following props are passed to each `ArrayFieldTemplate`:
104104
- `title`: A string value containing the title for the array.
105105
- `formContext`: The `formContext` object that you passed to Form.
106106
- `formData`: The formData for this array.
107+
- `errorSchema`: The optional validation errors for the array field and the items within it, in the form of an `ErrorSchema`
107108
- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this widget
108109
- `registry`: The `registry` object.
109110

packages/utils/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ export type ArrayFieldTemplateProps<
601601
formContext?: F;
602602
/** The formData for this array */
603603
formData?: T;
604+
/** The tree of errors for this field and its children */
605+
errorSchema?: ErrorSchema<T>;
604606
/** An array of strings listing all generated error messages from encountered errors for this widget */
605607
rawErrors?: string[];
606608
/** The `registry` object */

0 commit comments

Comments
 (0)