I use react-virtualized library, and Table component from the library. I should render additional rows below when clicking on the row. It looks similar, but has different data. How to do it in best practice?
There are also function defaultTableRowRenderer in the library.
I thought to use it for rowRenderer property in Table.
So I thought to pass the function to rowRenderer that returns a Fragment, and inside the Fragment I render main row with defaultTableRowRenderer, and under it I have a condition to render more Rows (maybe with the same defaultTableRowRenderer, but different props for different data and styles). So I created new object of custom props from the object of props from main row, just added some new props.
I also can render custom rows using just Cell components with new props.
I feel like it’s not really good and beautiful solution. Am I wrong? Is there a better way to do this?