MCPcopy
hub / github.com/TanStack/table / TableComponent

Function TableComponent

packages/react-table/tests/features/RowSelection.test.tsx:103–144  ·  view source on GitHub ↗
({
  options = {},
})

Source from the content-addressed store, hash-verified

101]
102
103const TableComponent: FC<{ options?: Partial<TableOptions<Person>> }> = ({
104 options = {},
105}) => {
106 const table = useReactTable({
107 data: defaultData,
108 columns: defaultColumns,
109 getCoreRowModel: getCoreRowModel(),
110 ...options,
111 })
112
113 return (
114 <table>
115 <thead>
116 {table.getHeaderGroups().map((headerGroup) => (
117 <tr key={headerGroup.id}>
118 {headerGroup.headers.map((header) => (
119 <th key={header.id} colSpan={header.colSpan}>
120 {header.isPlaceholder
121 ? null
122 : flexRender(
123 header.column.columnDef.header,
124 header.getContext(),
125 )}
126 </th>
127 ))}
128 </tr>
129 ))}
130 </thead>
131 <tbody>
132 {table.getRowModel().rows.map((row) => (
133 <tr key={row.id}>
134 {row.getVisibleCells().map((cell) => (
135 <td key={cell.id}>
136 {flexRender(cell.column.columnDef.cell, cell.getContext())}
137 </td>
138 ))}
139 </tr>
140 ))}
141 </tbody>
142 </table>
143 )
144}
145
146test(`Select all do not select rows which are not available for selection`, () => {
147 render(

Callers

nothing calls this directly

Calls 4

useReactTableFunction · 0.90
getCoreRowModelFunction · 0.90
flexRenderFunction · 0.90
getContextMethod · 0.80

Tested by

no test coverage detected