Skip to content

Commit

Permalink
Docs: Clarify registry object structure and that it's passed down to …
Browse files Browse the repository at this point in the history
…custom widgets (#2886)
  • Loading branch information
epicfaace authored Jun 20, 2022
1 parent cd69ac7 commit a2be0f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/advanced-customization/custom-widgets-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ The following props are passed to custom widget components:
- `options.enumOptions`: For enum fields, this property contains the list of options for the enum as an array of { label, value } objects. If the enum is defined using the oneOf/anyOf syntax, the entire schema object for each option is appended onto the { schema, label, value } object.
- `formContext`: The `formContext` object that you passed to Form.
- `rawErrors`: An array of strings listing all generated error messages from encountered errors for this widget.
- `registry`: A [registry](#the-registry-object) object (read next).

### Custom component registration

Expand Down Expand Up @@ -296,13 +297,13 @@ A field component will always be passed the following props:

The `registry` is an object containing the registered custom fields and widgets as well as the root schema definitions.

- `fields`: The [custom registered fields](#custom-field-components). By default this object contains the standard `SchemaField`, `TitleField` and `DescriptionField` components;
- `widgets`: The [custom registered widgets](#custom-widget-components), if any;
- `fields`: All fields, including [custom registered fields](#custom-field-components), if any;
- `widgets`: All widgets, including, [custom registered widgets](#custom-widget-components), if any;
- `rootSchema`: The root schema, which can contain referenced [definitions](#schema-definitions-and-references);
- `formContext`: The [formContext](#the-formcontext-object) object;
- `definitions` (deprecated since v2): Equal to `rootSchema.definitions`.

The registry is passed down the component tree, so you can access it from your custom field and `SchemaField` components.
The registry is passed down the component tree, so you can access it from your custom field, custom widget, and `SchemaField` components.

### Custom SchemaField

Expand Down

0 comments on commit a2be0f9

Please sign in to comment.