Skip to content

Commit edd2825

Browse files
ValYouWyuval_cpx
andauthored
update docs and TypeScript definitions for ObjectFieldTemplate (rjsf-team#1979)
Co-authored-by: yuval_cpx <yuval@cupixel.com>
1 parent 329da0d commit edd2825

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

docs/advanced-customization/custom-templates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ The following props are passed to each `ObjectFieldTemplate`:
201201
- `description`: A string value containing the description for the object.
202202
- `disabled`: A boolean value stating if the object is disabled.
203203
- `properties`: An array of object representing the properties in the array. Each of the properties represent a child with properties described below.
204+
- `onAddClick: (schema: JSONSchema7) => () => void`: Returns a function that adds a new property to the object (to be used with additionalProperties)
204205
- `readonly`: A boolean value stating if the object is read-only.
205206
- `required`: A boolean value stating if the object is required.
206207
- `schema`: The schema object for this object.

packages/core/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,15 @@ declare module '@rjsf/core' {
204204
TitleField: React.StatelessComponent<{ id: string; title: string; required: boolean }>;
205205
title: string;
206206
description: string;
207+
disabled: boolean;
207208
properties: {
208209
content: React.ReactElement;
209210
name: string;
210211
disabled: boolean;
211212
readonly: boolean;
212213
}[];
214+
onAddClick: (schema: JSONSchema7) => () => void;
215+
readonly: boolean;
213216
required: boolean;
214217
schema: JSONSchema7;
215218
uiSchema: UiSchema;

0 commit comments

Comments
 (0)