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

[BUG] - Hydration Error with Table selectionMode = multiple #4385

Open
TwoWheelDev opened this issue Dec 17, 2024 · 13 comments
Open

[BUG] - Hydration Error with Table selectionMode = multiple #4385

TwoWheelDev opened this issue Dec 17, 2024 · 13 comments
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@TwoWheelDev
Copy link

NextUI Version

2.6.8

Describe the bug

Using the example code from https://nextui.org/docs/components/table#use-case-example, causes a hydration error.

I have added the 'use client' as required (since the page uses useState etc).

Digging into it, if I change selectionMode="multiple" to selectionMode="single" the hydration error disappars, so the error appears to be with the column that is added to allow multiple selections

Your Example Website or App

https://codesandbox.io/p/devbox/elastic-tu-vydmx3?workspaceId=ws_WuwAJnJobgVN2wdMCvZdPR

Steps to Reproduce the Bug or Issue

Create a page, using the table full use case example - https://nextui.org/docs/components/table#use-case-example

Expected behavior

No Hydration Error

Screenshots or Videos

image
image

Operating System Version

Linux

Browser

Firefox

Copy link

linear bot commented Dec 17, 2024

@ShahinAlomShuvo
Copy link

I also face this issue, is it fixed or still happening?

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels Dec 21, 2024
@stiyyagura0901
Copy link

This worked for me. Might not be an ideal solution.

@largeprob
Copy link

largeprob commented Dec 25, 2024

我也遇到这样的错误存在,只要将表格切换为多选模式。
I also encountered such an error, just switch the table to multi select mode.

"@nextui-org/table": "^2.2.7",
"next": "15.1.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.6.3"

@SivaGanesh56
Copy link

+1

@J4v4Scr1pt
Copy link

I also face this issue, Don't use use NextThemeProvider as they talked about in suggested solution above.

@michaeltintiuc
Copy link

NextThemeProvider has nothing to do with this, you can see that the code sample doesn't even use it, the issue is that an extra th is injected for row selection

@tartane
Copy link

tartane commented Feb 20, 2025

Also having this issue, not using the NextThemeProvider. Removing the selectionMode="multiple" from the <Table> removes the error. any updates on this?

@nohira
Copy link

nohira commented Feb 24, 2025

Facing same issue with selectionMode="multiple". I hope we'll having fix as it's a quite common feature to have multi selection on table.

@davidaragundy
Copy link

this still an annoying issue :c

@davidaragundy
Copy link

davidaragundy commented Feb 25, 2025

for now, you can use:

import dynamic from "next/dynamic";

const Table = dynamic(() => import("@heroui/table").then((c) => c.Table), {
  ssr: false,
});

This MUST be inside a client component

@lukasssicevs
Copy link

Same issue here.

@JosepCumplido
Copy link

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests