scaffolder: form data fixups

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-05-19 15:17:05 +02:00
parent 38e898d6d7
commit 115f6452bf
3 changed files with 10 additions and 6 deletions
@@ -162,11 +162,15 @@ spec:
ui:field: MyCustomExtension
```
## Get data of other fields in Form from a Custom Field Extension
## Access Data from other Fields
Custom fields extensions can read data from other fields in the form via the form context. This
is something that we discourage due to the coupling that it creates, but is sometimes still
the most sensible solution.
```tsx
const CustomFieldExtensionComponent(props: FieldExtensionComponentProps<string[]>) => {
const { formContext } = props;
const CustomFieldExtensionComponent = (props: FieldExtensionComponentProps<string[]>) => {
const { formData } = props.formContext;
...
};