Skip to content

Commit fdbbf94

Browse files
olzraitin1k0
authored andcommitted
Pass schema & uiSchema to the field template component (#379)
1 parent 76828eb commit fdbbf94

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,8 @@ The following props are passed to a custom field template component:
694694
- `readonly`: A boolean value stating if the field is read-only.
695695
- `displayLabel`: A boolean value stating if the label should be rendered or not. This is useful for nested fields in arrays where you don't want to clutter the UI.
696696
- `fields`: An array containing all Form's fields including your [custom fields](#custom-field-components) and the built-in fields.
697+
- `schema`: The schema object for this field.
698+
- `uiSchema`: The uiSchema object for this field.
697699
- `formContext`: The `formContext` object that you passed to Form.
698700

699701
> Note: you can only define a single field template for a form. If you need many, it's probably time to look at [custom fields](#custom-field-components) instead.

src/components/fields/SchemaField.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ function SchemaField(props) {
202202
classNames,
203203
formContext,
204204
fields,
205+
schema,
206+
uiSchema,
205207
};
206208

207209
return <FieldTemplate {...fieldProps}>{field}</FieldTemplate>;

0 commit comments

Comments
 (0)