File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
examples/react/column-resizing-performant/src Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ function App() {
190190 ) ) }
191191 </ div >
192192 { /* When resizing any column we will render this special memoized version of our table body */ }
193- { table . getState ( ) . columnSizingInfo . isResizingColumn && enableMemo ? (
193+ { enableMemo ? (
194194 < MemoizedTableBody table = { table } />
195195 ) : (
196196 < TableBody table = { table } />
@@ -243,9 +243,10 @@ function TableBody({ table }: { table: Table<Person> }) {
243243}
244244
245245//special memoized wrapper for our table body that we will use during column resizing
246- export const MemoizedTableBody = React . memo (
247- TableBody ,
248- ( prev , next ) => prev . table . options . data === next . table . options . data
246+ export const MemoizedTableBody = React . memo ( TableBody , ( prev , next ) =>
247+ next . table . getState ( ) . columnSizingInfo . isResizingColumn
248+ ? prev . table . options . data === next . table . options . data
249+ : false
249250) as typeof TableBody
250251
251252const rootElement = document . getElementById ( 'root' )
You can’t perform that action at this time.
0 commit comments