Skip to content

Commit

Permalink
test: adds server component prop reproduction bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sacha-c committed Dec 11, 2024
1 parent a0f0316 commit 64dd976
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/_community/collections/Posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ export const PostsCollection: CollectionConfig = {
name: 'title',
type: 'text',
},
{
name: 'bugReproduction',
type: 'ui',
admin: {
components: {
Field: {
path: 'test/_community/components/FieldServerComponentIssue',
serverProps: {
myValue: () => 'hello world', // As a serverProp, I expect to be able to pass function and other unserializable data
},
},
},
},
},
],
versions: {
drafts: true,
Expand Down
9 changes: 9 additions & 0 deletions test/_community/components/FieldServerComponentIssue.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { FieldServerComponent } from 'payload'

const FieldServerComponentIssue: FieldServerComponent<any, any, { value: () => string }> = (
props,
) => {
return <div>{props.value()}</div>
}

export default FieldServerComponentIssue

0 comments on commit 64dd976

Please sign in to comment.