diff --git a/packages/payload/src/fields/config/client.ts b/packages/payload/src/fields/config/client.ts index b8f4140a5c2..d11779fcdde 100644 --- a/packages/payload/src/fields/config/client.ts +++ b/packages/payload/src/fields/config/client.ts @@ -37,7 +37,10 @@ export type ServerOnlyFieldProperties = | 'validate' | keyof Pick -export type ServerOnlyFieldAdminProperties = keyof Pick +export type ServerOnlyFieldAdminProperties = keyof Pick< + FieldBase['admin'], + 'components' | 'condition' +> const serverOnlyFieldProperties: Partial[] = [ 'hooks', @@ -57,7 +60,10 @@ const serverOnlyFieldProperties: Partial[] = [ // `tabs` // `admin` ] -const serverOnlyFieldAdminProperties: Partial[] = ['condition'] +const serverOnlyFieldAdminProperties: Partial[] = [ + 'condition', + 'components', +] type FieldWithDescription = { admin: AdminClient } & ClientField diff --git a/test/fields/collections/Array/index.ts b/test/fields/collections/Array/index.ts index 1fe4aec1bcf..dad95be90d6 100644 --- a/test/fields/collections/Array/index.ts +++ b/test/fields/collections/Array/index.ts @@ -32,7 +32,13 @@ const ArrayFields: CollectionConfig = { type: 'ui', admin: { components: { - Field: './collections/Array/LabelComponent.js#ArrayRowLabel', + Field: { + path: './collections/Array/LabelComponent.js#ArrayRowLabel', + serverProps: { + // While this doesn't do anything, this will reproduce a bug where having server-only props in here will throw a "Functions cannot be passed directly to Client Components" error + someFn: () => 'Hello', + }, + }, }, }, },