From bdbfafb69329621f5c0065147355f0c3bfe23a32 Mon Sep 17 00:00:00 2001 From: redonkulus Date: Tue, 15 Oct 2024 15:36:40 -0700 Subject: [PATCH] fix: use latest react-dom api --- src/libs/DebugDashboard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/DebugDashboard.js b/src/libs/DebugDashboard.js index 2bfecd51..75239128 100644 --- a/src/libs/DebugDashboard.js +++ b/src/libs/DebugDashboard.js @@ -4,7 +4,7 @@ */ import React, { Suspense, lazy } from 'react'; -import { render, unmountComponentAtNode } from 'react-dom'; +import { createRoot } from 'react-dom/client'; import { subscribe } from 'subscribe-ui-event'; // Dashboard only used in client side, could safely defered load @@ -112,7 +112,8 @@ const DebugDashboard = function DebugDashboard(i13nNode) { }); }; - render( + this.root = createRoot(container); + this.root.render( React.createElement( Suspense, { fallback: null }, @@ -142,7 +143,7 @@ DebugDashboard.prototype.destroy = function () { this.resizeHandler.unsubscribe(); } if (this.container) { - unmountComponentAtNode(this.container); + this.root.unmount(); document.body.removeChild(this.container); } };