MCPcopy Index your code
hub / github.com/TanStack/table / App

Function App

examples/react/full-width-table/src/main.tsx:15–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import { makeData, Person } from './makeData'
14
15function App() {
16 const rerender = React.useReducer(() => ({}), {})[1]
17
18 const columns = React.useMemo<ColumnDef<Person>[]>(
19 () => [
20 {
21 header: 'Name',
22 footer: (props) => props.column.id,
23 columns: [
24 {
25 accessorKey: 'firstName',
26 cell: (info) => info.getValue(),
27 footer: (props) => props.column.id,
28 },
29 {
30 accessorFn: (row) => row.lastName,
31 id: 'lastName',
32 cell: (info) => info.getValue(),
33 header: () => <span>Last Name</span>,
34 footer: (props) => props.column.id,
35 },
36 ],
37 },
38 {
39 header: 'Info',
40 footer: (props) => props.column.id,
41 columns: [
42 {
43 accessorKey: 'age',
44 header: () => 'Age',
45 footer: (props) => props.column.id,
46 },
47 {
48 accessorKey: 'visits',
49 header: () => <span>Visits</span>,
50 footer: (props) => props.column.id,
51 },
52 {
53 accessorKey: 'status',
54 header: 'Status',
55 footer: (props) => props.column.id,
56 },
57 {
58 accessorKey: 'progress',
59 header: 'Profile Progress',
60 footer: (props) => props.column.id,
61 },
62 ],
63 },
64 ],
65 [],
66 )
67
68 const [data, setData] = React.useState(() => makeData(100000))
69 const refreshData = () => setData(() => makeData(100000))
70
71 const [pagination, setPagination] = React.useState<PaginationState>({
72 pageIndex: 0,

Callers

nothing calls this directly

Calls 10

makeDataFunction · 0.90
useReactTableFunction · 0.90
flexRenderFunction · 0.90
getCoreRowModelFunction · 0.85
getPaginationRowModelFunction · 0.85
getContextMethod · 0.80
previousPageMethod · 0.80
nextPageMethod · 0.80
refreshDataFunction · 0.70
rerenderFunction · 0.50

Tested by

no test coverage detected