diff --git a/packages/app-extension/src/options/index.tsx b/packages/app-extension/src/options/index.tsx index 9cb4dde4b..62e26ac49 100644 --- a/packages/app-extension/src/options/index.tsx +++ b/packages/app-extension/src/options/index.tsx @@ -1,17 +1,21 @@ -import React, { lazy, Suspense } from "react"; +import { lazy, Suspense } from "react"; import { createRoot } from "react-dom/client"; -import Options from "./Options"; - +// Code-splitting keeps the options.js bundle under 4MB which is +// a requirement for Firefox extensions +const Options = lazy(() => import("./Options")); const LedgerIframe = lazy(() => import("../components/LedgerIframe")); // Render the UI. // TOOD(react) createRoot is required: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis const container = document.getElementById("options"); const root = createRoot(container!); + root.render( <> - + + +