TableView Render Behavior #4370
-
Following this example from the Spectrum site results in a table that re-renders the entire row whenever state changes within the component:
Is it possible to utilize TableView in such a way that only the relevant cells are updated when state/props change, rather than triggering a rerender and animation of the rows flying in? If so how would you go about doing that? Alternately, is it possible to disable this pop-in animation for rows that appears when new items are added to the table? I have seen discussions about reducing the transition time to 0, but this only makes a modest improvement (if any) and the animations are still present. Disabling the animations altogether would allow the entire table to be updated with the new values of the array of objects at once. For background: I am populating a table with data retrieved from several APIs that is then consolidated by a function into an array of objects containing the value of those calls after some calculations. I am polling this function on 1 second intervals and using this to create a new array with the new values and update state. When I do so, the entire row or rows redraws. With the animations this won’t be usable. I need to be able to dynamically update the value of each cell without triggering an animation. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Can you show what your data looks like? I'm suspicious that each row is missing an id that is stable between polls |
Beta Was this translation helpful? Give feedback.
Can you show what your data looks like? I'm suspicious that each row is missing an id that is stable between polls