From 2b4e3318ca2d221656d862a6524b076da820b78b Mon Sep 17 00:00:00 2001 From: AAGaming Date: Wed, 29 May 2024 21:01:49 -0400 Subject: fix latest beta VALVEEEEE --- frontend/src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'frontend/src/index.ts') diff --git a/frontend/src/index.ts b/frontend/src/index.ts index 6588cb5c..0faea32c 100644 --- a/frontend/src/index.ts +++ b/frontend/src/index.ts @@ -1,5 +1,13 @@ // Sets up DFL, then loads start.ts which starts up the loader (async () => { + if (!window.SP_REACT) { + console.debug('Setting up React globals...'); + // deliberate partial import + const DFLWebpack = await import('decky-frontend-lib/dist/webpack'); + // TODO move these finds to dfl in v4 + window.SP_REACT = DFLWebpack.findModule((m) => m.Component && m.PureComponent && m.useLayoutEffect); + window.SP_REACTDOM = DFLWebpack.findModule((m) => m.createPortal && m.createRoot); + } console.debug('Setting up decky-frontend-lib...'); window.DFL = await import('decky-frontend-lib'); await import('./start'); -- cgit v1.2.3