summaryrefslogtreecommitdiff
path: root/frontend/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/index.ts')
-rw-r--r--frontend/src/index.ts18
1 files changed, 13 insertions, 5 deletions
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index 2ee018e0..4f4ff4f7 100644
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -1,8 +1,4 @@
// Sets up DFL, then loads start.ts which starts up the loader
-interface Window {
- // Shut up TS
- SP_REACTDOM: any;
-}
(async () => {
console.debug('[Decky:Boot] Frontend init');
@@ -21,7 +17,19 @@ interface Window {
// deliberate partial import
const DFLWebpack = await import('@decky/ui/dist/webpack');
window.SP_REACT = DFLWebpack.findModule((m) => m.Component && m.PureComponent && m.useLayoutEffect);
- window.SP_REACTDOM = DFLWebpack.findModule((m) => m.createPortal && m.createRoot);
+ window.SP_REACTDOM =
+ DFLWebpack.findModule((m) => m.createPortal && m.createRoot) ||
+ DFLWebpack.findModule((m) => m.createPortal && m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE);
+
+ console.debug('[Decky:Boot] Setting up JSX internals...');
+ const jsx = DFLWebpack.findModule((m) => m.jsx && Object.keys(m).length == 1)?.jsx;
+ if (jsx) {
+ window.SP_JSX = {
+ jsx,
+ jsxs: jsx,
+ Fragment: window.SP_REACT.Fragment,
+ };
+ }
}
console.debug('[Decky:Boot] Setting up @decky/ui...');
window.DFL = await import('@decky/ui');