Skip to content

Commit

Permalink
fix: use latest react-dom api (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
redonkulus authored Oct 15, 2024
1 parent 3d7d526 commit 39b5ec0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libs/DebugDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -112,7 +112,8 @@ const DebugDashboard = function DebugDashboard(i13nNode) {
});
};

render(
this.root = createRoot(container);
this.root.render(
React.createElement(
Suspense,
{ fallback: null },
Expand Down Expand Up @@ -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);
}
};
Expand Down

0 comments on commit 39b5ec0

Please sign in to comment.