Skip to content

Commit

Permalink
fix: test render
Browse files Browse the repository at this point in the history
  • Loading branch information
KVNLS committed Oct 23, 2023
1 parent fc974c5 commit 8cb8180
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/ledger-live-desktop/src/renderer/init.tsx
Expand Up @@ -8,7 +8,10 @@ import { checkLibs } from "@ledgerhq/live-common/sanityChecks";
import { importPostOnboardingState } from "@ledgerhq/live-common/postOnboarding/actions";
import i18n from "i18next";
import { webFrame, ipcRenderer } from "electron";
import { createRoot } from "react-dom/client";
// We can't use new createRoot for now. We have issues we react-redux 7.x and lazy load of components
// https://github.com/reduxjs/react-redux/issues/1977
// eslint-disable-next-line react/no-deprecated
import { render } from "react-dom";
import moment from "moment";
import each from "lodash/each";
import { reload, getKey, loadLSS } from "~/renderer/storage";
Expand Down Expand Up @@ -47,7 +50,7 @@ import { Device } from "@ledgerhq/live-common/hw/actions/types";
import { listCachedCurrencyIds } from "./bridge/cache";
import { LogEntry } from "winston";

const domNode = document.getElementById("react-root");
const rootNode = document.getElementById("react-root");
const TAB_KEY = 9;

async function init() {
Expand Down Expand Up @@ -246,9 +249,8 @@ async function init() {
};
}
function r(Comp: JSX.Element) {
if (domNode) {
const rootNode = createRoot(domNode);
rootNode.render(Comp);
if (rootNode) {
render(Comp, rootNode);
}
}
init()
Expand Down

0 comments on commit 8cb8180

Please sign in to comment.