Merge pull request #11540 from tritri251214/form-context-scaffolder

[Scaffolder] Get data of other fields in Form from a custom field
This commit is contained in:
Johan Haals
2022-05-19 13:44:42 +02:00
committed by GitHub
3 changed files with 39 additions and 0 deletions
@@ -161,3 +161,20 @@ spec:
description: My custom name for the component
ui:field: MyCustomExtension
```
## Get data of other fields in Form from a Custom Field Extension
```tsx
const CustomFieldExtensionComponent(props: FieldExtensionComponentProps<string[]>) => {
const { formContext } = props;
...
};
const CustomFieldExtension = scaffolderPlugin.provide(
createScaffolderFieldExtension({
name: ...,
component: CustomFieldExtensionComponent,
validation: ...
})
);
```