scaffolder: form data fixups
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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;
|
||||
...
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user