From fb8d74d92e84e9a3b6fce532260c4cb3dab42c67 Mon Sep 17 00:00:00 2001 From: Leonard Date: Tue, 6 Jul 2021 18:21:28 +0200 Subject: [PATCH] :zap: allow providing the loadingoverlay as component to avoid complete rerenders with every load --- packages/react-bootstrap-table2/src/bootstrap-table.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-bootstrap-table2/src/bootstrap-table.js b/packages/react-bootstrap-table2/src/bootstrap-table.js index d42073360..4728cc46d 100644 --- a/packages/react-bootstrap-table2/src/bootstrap-table.js +++ b/packages/react-bootstrap-table2/src/bootstrap-table.js @@ -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; + + { this.renderTable() } + + } else if (overlay) { const LoadingOverlay = overlay(loading); return (