Skip to content

Commit 3852227

Browse files
committed
Fix custom cell render to allow pure functions
1 parent 1fec9b8 commit 3852227

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -746,12 +746,16 @@ export default React.createClass({
746746
{...tdProps.rest}
747747
>
748748
{typeof Cell === 'function' ? (
749-
<Cell
750-
{...rowInfo}
751-
value={rowInfo.rowValues[column.id]}
752-
/>
753-
) : typeof Cell !== 'undefined' ? Cell
754-
: rowInfo.rowValues[column.id]}
749+
Cell.prototype.isReactComponent ? (
750+
<Cell
751+
{...rowInfo}
752+
value={rowInfo.rowValues[column.id]}
753+
/>
754+
) : Cell({
755+
...rowInfo,
756+
value: rowInfo.rowValues[column.id]
757+
})
758+
) : rowInfo.rowValues[column.id]}
755759
</TdComponent>
756760
)
757761
})}

0 commit comments

Comments
 (0)