How to memoize rows correctly with @tanstack/react-table
#535
-
My code below is pretty representative of how I am rendering my table in my app. My problem comes when I wrap a) interacted with Any help on this would be great. As an aside, I have managed to get it to the point where the rows but not the cells rerender, however, this still seems suboptimal and also feels like I must be doing something wrong. My instinct is that my keys are wrong inside mapping of the rows, but I can't be sure.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
First
Overall in table most cases you want to memozie rows. |
Beta Was this translation helpful? Give feedback.
@jonahallibone you want your getItemKey to be
React.useCallback((index: number) => rows[index]?.id ?? index, [rows])