You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DISCLAIMER: While fairly well versed in react, I don't claim to be a performance expert or anything. I'm using this library for that very reason.
I'm experimenting with editability of tanstack table. It seems like it was never really the intent of tanstack table, but because of being a fairly straight forward and flexible library, editability can be added without too much work.
I've seen several issues here in github about editable performance, and I suspect many of them could be related to this very thing... the way the examples show updating data.
I have a couple concerns about the way data should be updated (as shown in the editable example anyway). It seems to tack a update method into meta, and then pass meta into components requires some amount of tweaking to satisfy typescripts type stuff (creating an interface and treat .meta as that type). Additionally the update data function example seems to be essentially mutating the row, and then spreading it into a new entire dataset that then gets assigned to the component. (I'd assume this isn't great for performance... especially if you are dealing with a large dataset).
I'm wondering if perhaps something like setCellValue or setValue could be passed in to the cell component and somehow have tanstack table be able to update the underlying data in such a way where tanstack can re-render that cell (and honestly I'm not sure it would need to, because the textbox or other edit component should already reflect the desired state), but not require essentially refreshing the entire dataset.
I feel like this would simplify things because then you wouldn't necessary need to maintain the functions to handle the updates in meta, you could simply have the components call setValue when we've deemed editing complete (onBlur or whatever). I think this would help reduce overhead on developers when implementing a table from scratch.
If there is already a better way to do this, or if something is already in the works... I'd be interested to hear about options. Likewise, if it seems like something that would fit with the authors, I'd be interested in at least looking into something like that.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
DISCLAIMER: While fairly well versed in react, I don't claim to be a performance expert or anything. I'm using this library for that very reason.
I'm experimenting with editability of tanstack table. It seems like it was never really the intent of tanstack table, but because of being a fairly straight forward and flexible library, editability can be added without too much work.
I've seen several issues here in github about editable performance, and I suspect many of them could be related to this very thing... the way the examples show updating data.
I have a couple concerns about the way data should be updated (as shown in the editable example anyway). It seems to tack a update method into meta, and then pass meta into components requires some amount of tweaking to satisfy typescripts type stuff (creating an interface and treat .meta as that type). Additionally the update data function example seems to be essentially mutating the row, and then spreading it into a new entire dataset that then gets assigned to the component. (I'd assume this isn't great for performance... especially if you are dealing with a large dataset).
I'm wondering if perhaps something like
setCellValue
orsetValue
could be passed in to the cell component and somehow have tanstack table be able to update the underlying data in such a way where tanstack can re-render that cell (and honestly I'm not sure it would need to, because the textbox or other edit component should already reflect the desired state), but not require essentially refreshing the entire dataset.I feel like this would simplify things because then you wouldn't necessary need to maintain the functions to handle the updates in meta, you could simply have the components call
setValue
when we've deemed editing complete (onBlur or whatever). I think this would help reduce overhead on developers when implementing a table from scratch.If there is already a better way to do this, or if something is already in the works... I'd be interested to hear about options. Likewise, if it seems like something that would fit with the authors, I'd be interested in at least looking into something like that.
Beta Was this translation helpful? Give feedback.
All reactions