nextui icon indicating copy to clipboard operation
nextui copied to clipboard

[BUG] - Table component not compatible with Server Components

Open a-corsini opened this issue 1 year ago • 8 comments

NextUI Version

2.0.20

Describe the bug

When trying to use the Table component (together with its respective subcomponents: TableHeader, TableColumn, TableBody, etc.) in a Server Component, the rendering fails with an error Unknown element <[object Object]> in collection.

Adding the 'use client' directive at the top of the file fixes the issue.

Is there any way to use the Table component natively in Server Components?

Thanks!

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Copy the code from https://nextui.org/docs/components/table#usage
  2. Paste it into a Server Component
  3. Expect an error during rendering

Expected behavior

I expected the Table to be fully compatible with Server Components.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Safari

a-corsini avatar Sep 05 '23 20:09 a-corsini