From 35ad8c7927321adbd01bcdacc524cf7d13ae07a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Suwi=C5=84ski?= Date: Mon, 13 Feb 2023 12:21:37 +0100 Subject: [PATCH] FieldGuesser: props passing to SingleFieldList --- src/FieldGuesser.tsx | 7 +++++-- src/types.ts | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/FieldGuesser.tsx b/src/FieldGuesser.tsx index 90e123de..d715d817 100644 --- a/src/FieldGuesser.tsx +++ b/src/FieldGuesser.tsx @@ -23,6 +23,7 @@ import type { NumberFieldProps, ReferenceArrayFieldProps, ReferenceFieldProps, + SingleFieldListProps, TextFieldProps, UrlFieldProps, } from 'react-admin'; @@ -65,11 +66,13 @@ const renderField = ( } const fieldName = schemaAnalyzer.getFieldNameFromSchema(field.reference); + const { linkType, ...rest } = props as ReferenceArrayFieldProps & + Pick; return ( - + diff --git a/src/types.ts b/src/types.ts index f060ef14..fb406d9b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -47,6 +47,7 @@ import type { ResourceProps, ShowProps, SimpleFormProps, + SingleFieldListProps, TabbedFormProps, TextFieldProps, TextInputProps, @@ -452,7 +453,7 @@ export type FieldProps = | UrlFieldProps | EmailFieldProps | ArrayFieldProps - | ReferenceArrayFieldProps + | (ReferenceArrayFieldProps & Pick) | EnumFieldProps | ReferenceFieldProps;