@@ -15,8 +15,8 @@ import {
1515 sortFns ,
1616 stockFeatures ,
1717} from '@tanstack/table-core'
18- import { useMemo } from 'react'
19- import { useStore } from '@tanstack/react-store'
18+ import { useCallback , useMemo } from 'react'
19+ import { shallow , useStore } from '@tanstack/react-store'
2020import { useTable } from './useTable'
2121import type {
2222 Cell ,
@@ -419,20 +419,21 @@ export function useLegacyTable<TData extends RowData>(
419419 }
420420
421421 // Call useTable with the v9 API, subscribing to all state changes
422- const table = useTable < StockFeatures , TData , TableState < StockFeatures > > ( {
423- ...restOptions ,
424- _features : stockFeatures ,
425- _rowModels,
426- } as TableOptions < StockFeatures , TData > )
427-
428- const state = useStore ( table . store , ( state ) => state )
422+ const table = useTable < StockFeatures , TData , TableState < StockFeatures > > (
423+ {
424+ ...restOptions ,
425+ _features : stockFeatures ,
426+ _rowModels,
427+ } as TableOptions < StockFeatures , TData > ,
428+ ( state ) => state ,
429+ )
429430
430431 return useMemo (
431432 ( ) =>
432433 ( {
433434 ...table ,
434- getState : ( ) => state ,
435+ getState : ( ) => table . state ,
435436 } ) as LegacyReactTable < TData > ,
436- [ table , state ] ,
437+ [ table ] ,
437438 )
438439}
0 commit comments