'Can I change className of the antd table's specific tr dynamically?

I have a toggler button in each tr of my ant design table that when the user clicks on it, I want to add/remove a specific class to/from its parent tr.

I know there are ways with vanilla js but I'm coding with React library, so I don't want to manipulate DOM directly.

To be more precise, I already tried rowClassName and it won't help! (It adds the given class to all of the rows.)



Sources

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

Source: Stack Overflow

Solution Source