diff --git a/es/DockLayout.js b/es/DockLayout.js index d6f11ed4..63fa1065 100644 --- a/es/DockLayout.js +++ b/es/DockLayout.js @@ -68,8 +68,12 @@ class DockPortalManager extends React.PureComponent { } /** @ignore */ updateTabCache(id, children) { + var _a; let cache = this._caches.get(id); if (cache) { + if (Object.is((_a = cache.portal) === null || _a === void 0 ? void 0 : _a.children, children)) { + return; + } cache.portal = ReactDOM.createPortal(children, cache.div, cache.id); this.forceUpdate(); } diff --git a/lib/DockLayout.js b/lib/DockLayout.js index f1108c24..cdbf3b12 100644 --- a/lib/DockLayout.js +++ b/lib/DockLayout.js @@ -93,8 +93,12 @@ class DockPortalManager extends React.PureComponent { } /** @ignore */ updateTabCache(id, children) { + var _a; let cache = this._caches.get(id); if (cache) { + if (Object.is((_a = cache.portal) === null || _a === void 0 ? void 0 : _a.children, children)) { + return; + } cache.portal = ReactDOM.createPortal(children, cache.div, cache.id); this.forceUpdate(); } diff --git a/src/DockLayout.tsx b/src/DockLayout.tsx index fcaea363..995e8898 100644 --- a/src/DockLayout.tsx +++ b/src/DockLayout.tsx @@ -161,6 +161,9 @@ class DockPortalManager extends React.PureComponent { updateTabCache(id: string, children: React.ReactNode): void { let cache = this._caches.get(id); if (cache) { + if (Object.is(cache.portal?.children, children)) { + return; + } cache.portal = ReactDOM.createPortal(children, cache.div, cache.id); this.forceUpdate(); }