diff --git a/src/index.js b/src/index.js index 9d6be77..f5b62a0 100644 --- a/src/index.js +++ b/src/index.js @@ -530,13 +530,22 @@ export default class ReactTable extends Methods(Lifecycle(Component)) { )) const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent - // Is this column pivoted? + // Is this cell expandable? if (cellInfo.pivoted || cellInfo.expander) { - // Make it expandable - cellInfo.expandable = cellInfo.subRows + // Make it expandable by defualt + cellInfo.expandable = true interactionProps = { onClick: onExpanderClick } + // If pivoted, has no subRows, and does not have a subComponent, do not make expandable + if (cellInfo.pivoted) { + if (!cellInfo.subRows) { + if (!SubComponent) { + cellInfo.expandable = false + interactionProps = {} + } + } + } } if (cellInfo.pivoted) {