Replies: 1 comment 2 replies
-
Are you using React Aria Components Tables? or are you using hooks? You should be able to use a custom wrapped row, see https://react-spectrum.adobe.com/react-aria/Table.html#reusable-wrappers Note, if you're following the hooks docs, they use an old implementation of Collections which is not this flexible. If you use React Aria Components, it uses the new Collections and you don't need |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a table with an "actions" column. One of these actions is "delete row".
Now, I can have a centralized mutation for deleting any given row, and also adding a state indicating which row is currently being deleted (until the deletion request resolves) in order to visually "disable" the row that's being deleted
OR
I can simply have a custom Row component that encapsulates the deleteion mutation, so when a row gets deleted then it's much easier to simply make any modifications I want just to that row, without the need to keep track of the row id, etc.
In essence, I want to do something like this:
Unfortunately, it seems that
TableBody
only accepts ogRow
elements as children. I managed to get as far as something like thisBut I am getting this error:
Is what i am trying to do even possible? If so, how?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions