File tree 1 file changed +10
-5
lines changed
packages/table-core/src/core
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -374,15 +374,20 @@ export function createTable<TData extends RowData>(
374
374
getRowModel : ( ) => {
375
375
return table . getPaginationRowModel ( )
376
376
} ,
377
+ //in next version, we should just pass in the row model as the optional 2nd arg
377
378
getRow : ( id : string , searchAll ?: boolean ) => {
378
- const row = ( searchAll ? table . getCoreRowModel ( ) : table . getRowModel ( ) )
379
- . rowsById [ id ]
379
+ let row = (
380
+ searchAll ? table . getPrePaginationRowModel ( ) : table . getRowModel ( )
381
+ ) . rowsById [ id ]
380
382
381
383
if ( ! row ) {
382
- if ( process . env . NODE_ENV !== 'production' ) {
383
- throw new Error ( `getRow expected an ID, but got ${ id } ` )
384
+ row = table . getCoreRowModel ( ) . rowsById [ id ]
385
+ if ( ! row ) {
386
+ if ( process . env . NODE_ENV !== 'production' ) {
387
+ throw new Error ( `getRow could not find row with ID: ${ id } ` )
388
+ }
389
+ throw new Error ( )
384
390
}
385
- throw new Error ( )
386
391
}
387
392
388
393
return row
You can’t perform that action at this time.
0 commit comments