Replies: 4 comments 14 replies
-
I have same question |
Beta Was this translation helpful? Give feedback.
-
I believe you are able to pass additional object properties in the second argument to Edit: One way to handle the type definition issue if you are using TypeScript is to create a custom context type and cast the argument for the import { createColumnHelper, CellContext as TanCellContext } from "@tanstack/react-table";
type CellContext<TData extends RowData, TValue> = TanCellContext<
TData,
TValue
> & {
additionalProp: string;
};
type RowType = { myProp: string; };
const columnHelper = createColumnHelper<RowType>();
const columns = [
columnHelper.accessor("myProp", {
cell: (info: unknown) => {
const infoCasted = info as CellContext<RowType, string>;
return <p>{infoCasted.getValue()}: {infoCasted.additionalProp}</p>;
},
}),
]; |
Beta Was this translation helpful? Give feedback.
-
For anyone else looking for a different way, the package exposes an argument called "meta" which can be extended. Please check here, |
Beta Was this translation helpful? Give feedback.
-
I ended up using react's useContext() to access my data inside the target component |
Beta Was this translation helpful? Give feedback.
-
How in v8 pass props from cell renderer to custom made input?
Beta Was this translation helpful? Give feedback.
All reactions