Skip to content
Permalink
Browse files

Add selectedFlatRows (#1597)

  • Loading branch information...
stramel authored and tannerlinsley committed Oct 14, 2019
1 parent 1ea6773 commit 4b7c85624b985ea64db6bae54cd8a903c2c10378
Showing with 4 additions and 3 deletions.
  1. +2 −2 TYPESCRIPT.md
  2. +2 −1 index.d.ts
@@ -2,7 +2,7 @@

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`.

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.
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.

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.

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

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.
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.

## Caveat

@@ -452,6 +452,7 @@ export interface UseRowSelectInstanceProps<D extends object> {
toggleRowSelectedAll: (set?: boolean) => void
getToggleAllRowsSelectedProps: (props?: object) => object
isAllRowsSelected: boolean
selectedFlatRows: Array<Row<D>>
}

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

0 comments on commit 4b7c856

Please sign in to comment.
You can’t perform that action at this time.