Skip to content

Commit 4b7c856

Browse files
strameltannerlinsley
authored andcommitted
Add selectedFlatRows (TanStack#1597)
1 parent 1ea6773 commit 4b7c856

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

TYPESCRIPT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
React-table is a very flexible library, because of this, the shape of data at almost every contact point is defined by the specific set of plugins that you choose to pass to `useTable`.
44

5-
Tto get started, copy the file `react-table-config.d.ts` into your source tree (e.g. into a types folder). This expands the default types with all of the plugin extensions currently in the type definitions.
5+
To get started, copy the file `react-table-config.d.ts` into your source tree (e.g. into a types folder). This expands the default types with all of the plugin extensions currently in the type definitions.
66

77
You can stop here if you like, but while this is simple, it's a bit misleading. Out of the box, these types will suggest that you have access to values that come from plugins that you aren't using, i.e. the error checking is weakened.
88

@@ -32,7 +32,7 @@ export interface TableOptions<D extends object>
3232
UseSortByOptions<D> {}
3333
```
3434

35-
Then follow the same pattern for all of the other interfaces in the file. You'll notice that many plugins don't extends all of the top level interfaces.
35+
Then follow the same pattern for all of the other interfaces in the file. You'll notice that many plugins don't extend all of the top-level interfaces.
3636

3737
## Caveat
3838

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ export interface UseRowSelectInstanceProps<D extends object> {
452452
toggleRowSelectedAll: (set?: boolean) => void
453453
getToggleAllRowsSelectedProps: (props?: object) => object
454454
isAllRowsSelected: boolean
455+
selectedFlatRows: Array<Row<D>>
455456
}
456457

457458
export interface UseRowSelectRowProps<D extends object> {
@@ -521,7 +522,7 @@ export type UseSortByOptions<D extends object> = Partial<{
521522
rows: Array<Row<D>>,
522523
sortFns: Array<SortByFn<D>>,
523524
directions: boolean[]
524-
) => Array<Row<D>> // CHECK
525+
) => Array<Row<D>>
525526
sortTypes: Record<string, SortByFn<D>>
526527
}>
527528

0 commit comments

Comments
 (0)