()
| 29 | } |
| 30 | |
| 31 | function App() { |
| 32 | const rerender = React.useReducer(() => ({}), {})[1] |
| 33 | |
| 34 | const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>( |
| 35 | [], |
| 36 | ) |
| 37 | |
| 38 | const columns = React.useMemo<ColumnDef<Person, any>[]>( |
| 39 | () => [ |
| 40 | { |
| 41 | accessorKey: 'firstName', |
| 42 | cell: (info) => info.getValue(), |
| 43 | }, |
| 44 | { |
| 45 | accessorFn: (row) => row.lastName, |
| 46 | id: 'lastName', |
| 47 | cell: (info) => info.getValue(), |
| 48 | header: () => <span>Last Name</span>, |
| 49 | }, |
| 50 | { |
| 51 | accessorKey: 'age', |
| 52 | header: () => 'Age', |
| 53 | meta: { |
| 54 | filterVariant: 'range', |
| 55 | }, |
| 56 | }, |
| 57 | { |
| 58 | accessorKey: 'visits', |
| 59 | header: () => <span>Visits</span>, |
| 60 | meta: { |
| 61 | filterVariant: 'range', |
| 62 | }, |
| 63 | }, |
| 64 | { |
| 65 | accessorKey: 'status', |
| 66 | header: 'Status', |
| 67 | meta: { |
| 68 | filterVariant: 'select', |
| 69 | }, |
| 70 | }, |
| 71 | { |
| 72 | accessorKey: 'progress', |
| 73 | header: 'Profile Progress', |
| 74 | meta: { |
| 75 | filterVariant: 'range', |
| 76 | }, |
| 77 | }, |
| 78 | ], |
| 79 | [], |
| 80 | ) |
| 81 | |
| 82 | const [data, setData] = React.useState<Person[]>(() => makeData(5_000)) |
| 83 | const refreshData = () => setData((_old) => makeData(100_000)) //stress test |
| 84 | |
| 85 | const table = useReactTable({ |
| 86 | data, |
| 87 | columns, |
| 88 | state: { |
nothing calls this directly
no test coverage detected