Upgrade to React@18 (#5172)

* upgrade to react@18
read more: https://reactjs.org/blog/2022/03/29/react-v18.html
This commit is contained in:
Roman authored and GitHub committed 2022-04-07 17:23:52 +03:00
1 parent 06e7dfce5e
commit 71b222f9d0
6 files changed
+46 -49

No files matched your search

@@ -5,7 +5,6 @@
import { delay } from "../../../../common/utils";
import { broadcastMessage } from "../../../../common/ipc";
import logger from "../../../../common/logger";
import { unmountComponentAtNode } from "react-dom";
import type { ExtensionLoading } from "../../../../extensions/extension-loader";
import type { CatalogEntityRegistry } from "../../../api/catalog-entity-registry";
import { bundledExtensionsLoaded } from "../../../../common/ipc/extension-handling";
@@ -34,10 +33,9 @@ export const initRootFrame =
lensProtocolRouterRenderer,
ipcRenderer,
registerIpcListeners,
catalogEntityRegistry,
}: Dependencies) =>
async (rootElem: HTMLElement) => {
async (unmountRoot: () => void) => {
catalogEntityRegistry.init();
try {
@@ -72,6 +70,6 @@ export const initRootFrame =
window.addEventListener("beforeunload", () => {
logger.info(`${logPrefix} Unload app`);
unmountComponentAtNode(rootElem);
unmountRoot();
});
};