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

Function TableBodyRow

examples/react/virtualized-rows-experimental/src/main.tsx:256–293  ·  view source on GitHub ↗
({
  row,
  rowRefsMap,
  rowVirtualizer,
  virtualRowIndex,
}: TableBodyRowProps)

Source from the content-addressed store, hash-verified

254}
255
256function TableBodyRow({
257 row,
258 rowRefsMap,
259 rowVirtualizer,
260 virtualRowIndex,
261}: TableBodyRowProps) {
262 return (
263 <tr
264 data-index={virtualRowIndex} // needed for dynamic row height measurement
265 ref={node => {
266 if (node && virtualRowIndex) {
267 rowVirtualizer.measureElement(node) // measure dynamic row height
268 rowRefsMap.current.set(virtualRowIndex, node) // store ref for virtualizer to apply scrolling transforms
269 }
270 }}
271 key={row.id}
272 style={{
273 display: 'flex',
274 position: 'absolute',
275 width: '100%',
276 }}
277 >
278 {row.getVisibleCells().map(cell => {
279 return (
280 <td
281 key={cell.id}
282 style={{
283 display: 'flex',
284 width: cell.column.getSize(),
285 }}
286 >
287 {flexRender(cell.column.columnDef.cell, cell.getContext())}
288 </td>
289 )
290 })}
291 </tr>
292 )
293}
294
295// test out when rows don't re-render at all (future TanStack Virtual release can make this unnecessary)
296const TableBodyRowMemo = React.memo(

Callers

nothing calls this directly

Calls 2

flexRenderFunction · 0.90
getContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…