Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 3253 By adding schema to ArrayFieldTemplateItemType type #3298

Merged
merged 1 commit into from Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,17 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.

-->
# 5.0.0-beta-15

# @rjsf/core
- Pass the `schema` along to the `ArrayFieldItemTemplate` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253)

# @rjsf/utils
- Update the `ArrayFieldItemTemplate` to add `schema` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253)

## Dev / docs / playground
- Fixed the documentation for `ArrayFieldItemTemplate` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253)

# 5.0.0-beta.14

## @rjsf/antd
Expand Down
1 change: 1 addition & 0 deletions docs/advanced-customization/custom-templates.md
Expand Up @@ -222,6 +222,7 @@ The following props are passed to each `ArrayFieldItemTemplate`:
- `onDropIndexClick: (index) => (event?) => void`: Returns a function that removes the item at `index`.
- `onReorderClick: (index, newIndex) => (event?) => void`: Returns a function that swaps the items at `index` with `newIndex`.
- `readonly`: A boolean value stating if the array item is read-only.
- `schema`: The schema object for this array item.
- `uiSchema`: The uiSchema object for this array item.
- `registry`: The `registry` object.

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/fields/ArrayField.tsx
Expand Up @@ -862,6 +862,7 @@ class ArrayField<
onReorderClick: this.onReorderClick,
readonly,
registry,
schema: itemSchema,
uiSchema: itemUiSchema,
};
}
Expand Down
4 changes: 3 additions & 1 deletion packages/utils/src/types.ts
Expand Up @@ -520,7 +520,9 @@ export type ArrayFieldTemplateItemType<
readonly: boolean;
/** A stable, unique key for the array item */
key: string;
/** The uiSchema object for this field */
/** The schema object for this array item */
schema: S;
/** The uiSchema object for this array item */
uiSchema?: UiSchema<T, S, F>;
/** The `registry` object */
registry: Registry<T, S, F>;
Expand Down