MUI TablePagination 组件导致 Next.js 13 中出现水合错误

问题描述 投票:0回答:1

使用 MUI TablePagination 组件时,我在 Next.js 13 中遇到水合错误。

错误看起来像这样

错误:水合失败,因为初始 UI 与服务器上呈现的内容不匹配。

警告:预计服务器 HTML 在 中包含匹配的

我在网上找不到任何关于此的信息。

有什么线索可以解决这个问题吗?

reactjs next.js material-ui
1个回答
0
投票

尝试添加

component="div"

<TablePagination
    component="div"
    onPageChange={(e, cnt) => setPage(cnt)}
    page={page}
© www.soinside.com 2019 - 2024. All rights reserved.