chore: fix formData should be undefined
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -64,7 +64,7 @@ export interface ScaffolderRJSFFieldProps<
|
||||
/** The tree of unique ids for every child field */
|
||||
idSchema: IdSchema<T>;
|
||||
/** The data for this field */
|
||||
formData: T;
|
||||
formData?: T;
|
||||
/** The tree of errors for this field and its children */
|
||||
errorSchema?: ErrorSchema<T>;
|
||||
/** The field change event handler; called with the updated form data and an optional `ErrorSchema` */
|
||||
|
||||
@@ -115,7 +115,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => {
|
||||
}
|
||||
|
||||
// We need to check against formData here as that's the previous value for this field.
|
||||
if (formData.includes(ref) || allowArbitraryValues) {
|
||||
if (formData?.includes(ref) || allowArbitraryValues) {
|
||||
return entityRef;
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ export const MultiEntityPicker = (props: MultiEntityPickerProps) => {
|
||||
required={required}
|
||||
InputProps={{
|
||||
...params.InputProps,
|
||||
required: formData.length === 0 && required,
|
||||
required: formData?.length === 0 && required,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user