TS2322: Type 'ColumnDef<Product, string>' is not assignable to type 'ColumnDef<Product, unknown>'. #4384
-
Hello, I am using Having faithfully followed the code in the docs this is what I have: import {ColumnDef, createColumnHelper} from "@tanstack/react-table";
type Product = {
name: string;
}
const columnHelper = createColumnHelper<Product>();
export const productTableColumns: ColumnDef<Product>[] = [
columnHelper.accessor('name', {
cell: info => info.getValue(),
header: () => 'Name',
}),
] However, the code above will produce the following TS error:
A more readable version of the error: Could you tell me please why this is happening and how to fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unfortunately, currently the 2322 error seems to occur unless you do the following.
|
Beta Was this translation helpful? Give feedback.
Unfortunately, currently the 2322 error seems to occur unless you do the following.