nextui
nextui copied to clipboard
[BUG] - Table component not compatible with Server Components
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
- Copy the code from https://nextui.org/docs/components/table#usage
- Paste it into a Server Component
- 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