'Adding class for expanded rows in react-table

I have created a table following this codepen to allow for expandable rows: https://react-table.tanstack.com/docs/examples/expanding

I would like to add a class to just the expanded rows to change the background color and remove borders. I saw that you could change the style of the toggle element, but I wasn't able to find a way to target the expanded rows and add a class to the cells/rows. Do you know if there is a way to add a class to just the expanded rows?

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source