Skip to content

Commit

Permalink
⚡ allow providing the loadingoverlay as component to avoid complete r…
Browse files Browse the repository at this point in the history
…erenders with every load
  • Loading branch information
leoek committed Jul 6, 2021
1 parent 7fca9b8 commit fb8d74d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react-bootstrap-table2/src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ class BootstrapTable extends PropsBaseResolver(Component) {
}

render() {
const { loading, overlay } = this.props;
if (overlay) {
const { loading, overlay, overlayComponent } = this.props;
if (overlayComponent){
const LoadingOverlay = overlayComponent;
<LoadingOverlay active={loading}>
{ this.renderTable() }
</LoadingOverlay>
} else if (overlay) {
const LoadingOverlay = overlay(loading);
return (
<LoadingOverlay>
Expand Down

0 comments on commit fb8d74d

Please sign in to comment.