tanstack-table

Use context7 for the latest documentation. Use deepwiki to ask questions about the library's implementation.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tanstack-table" with this command: npx skills add casper-studios/casper-marketplace/casper-studios-casper-marketplace-tanstack-table

Documentation

Use context7 for the latest documentation. Use deepwiki to ask questions about the library's implementation.

TanStack Table Patterns

This skill covers TanStack Table library patterns with the meta field for passing behavior to cells.

Core Pattern: Hoisted Columns with Meta

// 1. Extend TableMeta for type safety declare module '@tanstack/react-table' { interface TableMeta<TData extends RowData> { onEdit?: (id: string) => void; onDelete?: (id: string) => void; } }

// 2. Hoist column definitions outside component const columnHelper = createColumnHelper<Job>();

const columns = [ columnHelper.accessor('name', { header: 'Name', cell: info => info.getValue(), }), columnHelper.display({ id: 'actions', cell: ({ row, table }) => ( <Button onClick={() => table.options.meta?.onEdit?.(row.original.id)}>Edit</Button> ), }), ];

// 3. Pass callbacks via meta function DataTable({ data, onEdit, onDelete }: Props) { const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel(), meta: { onEdit, onDelete }, });

return &#x3C;Table>...&#x3C;/Table>;

}

Why Meta Over Closures?

Closures in column definitions cause re-renders:

// Bad - new column array every render const columns = useMemo(() => [ { cell: ({ row }) => ( <Button onClick={() => onEdit(row.original.id)}>Edit</Button> ), }, ], [onEdit]); // Invalidates when onEdit changes

// Good - stable columns, dynamic meta const columns = [...]; // Hoisted, never changes

const table = useReactTable({ meta: { onEdit }, // Only meta changes });

References

  • For column definition patterns, see column-definitions.md

  • For meta field type safety, see meta-field.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

pr-summary

No summary provided by upstream source.

Repository SourceNeeds Review
General

firecrawl-scraping

No summary provided by upstream source.

Repository SourceNeeds Review
General

pr-comments

No summary provided by upstream source.

Repository SourceNeeds Review