diff --git a/examples/react/table/src/main.tsx b/examples/react/table/src/main.tsx index 20dc2e3e..8ed0d807 100644 --- a/examples/react/table/src/main.tsx +++ b/examples/react/table/src/main.tsx @@ -26,12 +26,12 @@ function ReactTableVirtualized() { }, { accessorKey: 'firstName', - cell: info => info.getValue(), + cell: (info) => info.getValue(), }, { - accessorFn: row => row.lastName, + accessorFn: (row) => row.lastName, id: 'lastName', - cell: info => info.getValue(), + cell: (info) => info.getValue(), header: () => Last Name, }, { @@ -56,10 +56,10 @@ function ReactTableVirtualized() { { accessorKey: 'createdAt', header: 'Created At', - cell: info => info.getValue().toLocaleString(), + cell: (info) => info.getValue().toLocaleString(), }, ], - [] + [], ) const [data, setData] = React.useState(() => makeData(50_000)) @@ -76,8 +76,7 @@ function ReactTableVirtualized() { debugTable: true, }) - const {rows} = table.getRowModel(); - + const { rows } = table.getRowModel() const parentRef = React.useRef(null) @@ -85,17 +84,17 @@ function ReactTableVirtualized() { count: rows.length, getScrollElement: () => parentRef.current, estimateSize: () => 34, - overscan: 20 - }); + overscan: 20, + }) return (
-
+
- {table.getHeaderGroups().map(headerGroup => ( + {table.getHeaderGroups().map((headerGroup) => ( - {headerGroup.headers.map(header => { + {headerGroup.headers.map((header) => { return ( - {row.getVisibleCells().map(cell => { + + {row.getVisibleCells().map((cell) => { return ( ) @@ -151,7 +154,8 @@ function ReactTableVirtualized() { })}
{flexRender( header.column.columnDef.header, - header.getContext() + header.getContext(), )} {{ asc: ' 🔼', @@ -131,17 +130,21 @@ function ReactTableVirtualized() { {virtualizer.getVirtualItems().map((virtualRow, index) => { const row = rows[virtualRow.index] as Row return ( -
{flexRender( cell.column.columnDef.cell, - cell.getContext() + cell.getContext(), )}
-
+
+ ) } @@ -159,7 +163,10 @@ function App() { return (

- For tables, the basis for the offset of the translate css function is from the row's initial position itself. Because of this, we need to calculate the translateY pixel count different and base it off the the index. + For tables, the basis for the offset of the translate css function is + from the row's initial position itself. Because of this, we need to + calculate the translateY pixel count different and base it off the the + index.


diff --git a/package.json b/package.json index 389da0a9..524950ef 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "linkAll": "lerna exec 'npm link' --parallel", "unlinkAll": "lerna exec 'npm unlink' --parallel", "dev": "npm run clean && npm run watch", - "prettier": "prettier \"packages/*/{src/**,examples/**/src/**}.{md,js,jsx,ts,tsx,json}\" --write", + "prettier": "prettier \"{packages/*/src/**,examples/*/*/src/**}.{md,js,jsx,ts,tsx,vue,json}\" --write", "visualize": "lerna exec 'open build/stats-html.html'", "cipublish": "ts-node scripts/publish.ts", "cipublishforce": "CI=true npm run cipublish",