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

Can't use label function for document view tab #8314

Open
amun1620 opened this issue Sep 19, 2024 · 0 comments
Open

Can't use label function for document view tab #8314

amun1620 opened this issue Sep 19, 2024 · 0 comments
Assignees
Labels

Comments

@amun1620
Copy link

Link to reproduction

No response

Environment Info

Node: 20.17.0
Payload: 3.0.0-beta.107
Next: 15.0.0-canary.104

Describe the Bug

Using a function to set the tab label on a custom document view throws this error:

 ⨯ Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  {label: function label, href: ...}
          ^^^^^^^^^^^^^^
    at stringify (<anonymous>)
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)

Reproduction Steps

  admin: {
    components: {
      views: {
        edit: {
          customView: {
            Component: "/src/components/custom-view#CustomView",
            path: "/custom-view",
            tab: {
              label: ({ t }) => t("myCollection:customViewLabel"),
              href: "/custom-view",
            },
          },
        },
      },
    },
  },

Adapters and Plugins

No response

@amun1620 amun1620 added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Sep 19, 2024
@paulpopus paulpopus self-assigned this Sep 19, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants