AlePouroullis
AlePouroullis

Reputation: 511

MUI TablePagination Component Causing Hydration Error in Next.js 13

I'm getting a hydration error in Next.js 13 when using the MUI TablePagination component.

The error looks like this

Error: Hydration failed because the initial UI does not match what was rendered on the server.

Warning: Expected server HTML to contain a matching <td> in <div>.

I couldn't find anything online about this.

Any clue how to get around this?

Upvotes: 2

Views: 287

Answers (2)

Chuong Lac
Chuong Lac

Reputation: 31

Adding component="div" works for me.

Upvotes: 0

Den Rash
Den Rash

Reputation: 81

Try to add component="div"

<TablePagination
    component="div"
    onPageChange={(e, cnt) => setPage(cnt)}
    page={page}

Upvotes: 1

Related Questions