Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Payload 3.0.1] Custom Server Components Not Receiving Any Properties #9359

Open
danhstevens opened this issue Nov 19, 2024 · 2 comments
Open
Assignees

Comments

@danhstevens
Copy link

Describe the Bug

According to the documentation (https://payloadcms.com/docs/admin/components#default-props), custom server components are provided with properties such as the payload class. However, no properties are passed into server components.

Example component:

import React from 'react'

export const TeamSelector = async ({ payload }) => {
  console.log('SHOULD HAVE A PAYLOAD OBJECT HERE', payload) // undefined
  return <div>123</div>
}

Expected Result: SHOULD HAVE A PAYLOAD OBJECT HERE [payload class data]
Actual Result: SHOULD HAVE A PAYLOAD OBJECT HERE undefined

Link to the code that reproduces this issue

https://github.com/danhstevens/payload-issue

Reproduction Steps

  1. Create a new Payload project (v3)
  2. Add a custom server component that accepts any properties and apply to payload.config.ts
  3. Note how no properties are passed into the component

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Payload: 3.0.1
Node: 20
@danhstevens danhstevens added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Nov 19, 2024
@JarrodMFlesch JarrodMFlesch self-assigned this Nov 20, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 20, 2024
@JarrodMFlesch
Copy link
Contributor

Just noting that this has to do with the actions property specifically.

@SelfhostedPro
Copy link

SelfhostedPro commented Nov 21, 2024

Also affects client components. Using the basic template from the docs here

This is all I have for config:

    components: {
      views: {
        dashboard: {
          Component: '@/components/payload/views/Root'
        }
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants