File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
packages/table-core/src/core Expand file tree Collapse file tree 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>(
374374 getRowModel : ( ) => {
375375 return table . getPaginationRowModel ( )
376376 } ,
377+ //in next version, we should just pass in the row model as the optional 2nd arg
377378 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 ]
380382
381383 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 ( )
384390 }
385- throw new Error ( )
386391 }
387392
388393 return row
You can’t perform that action at this time.
0 commit comments