-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Description
TanStack Table version
v8.21.3
Framework/Library version
react v19.2.3
Describe the bug and the steps to reproduce it
When using useReactTable() from TanStack Table in a React Client Component, React Compiler emits the following warning:
Compilation Skipped: Use of incompatible library
TanStack Table'suseReactTable()API returns functions that cannot be memoized safely.
React Compiler automatically skips memoizing the component/hook to avoid potential stale UI.
This appears to be an expected behavior, as useReactTable() returns a mutable table instance with methods whose references may change across renders. However, the warning can be confusing for users adopting React Compiler, especially in common setups like Next.js + App Router.
Example
"use client";
import {
ColumnDef,
getCoreRowModel,
useReactTable,
} from "@tanstack/react-table";
export function DataTable<TData, TValue>({
columns,
data,
}: {
columns: ColumnDef<TData, TValue>[];
data: TData[];
}) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});
return null;
}Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://github.com/shadcn-ui/ui/blob/main/deprecated/www/components/cards/data-table.tsx
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
coderabbitai
Metadata
Metadata
Assignees
Labels
No labels