From b0b16d38981222159a70ea326714ab593837f6bb Mon Sep 17 00:00:00 2001 From: Yair Even Or Date: Thu, 24 Oct 2024 20:46:09 +0700 Subject: [PATCH] fixes #1373 - removed top-level `await` in order to resolve the error: "await is only valid in async functions and the top level bodies of modules" --- src/react-compat-layer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/react-compat-layer.js b/src/react-compat-layer.js index 7d2fe587..55f5fa85 100644 --- a/src/react-compat-layer.js +++ b/src/react-compat-layer.js @@ -5,7 +5,7 @@ let useEffect; let useRef; let useCallback; -async function initReact() { +function initReact() { try { // Try to import React as a namespace (React 18+) const ReactModule = await import('react'); @@ -16,7 +16,7 @@ async function initReact() { } } -await initReact(); +initReact(); function renderToStaticMarkup(element) { if (typeof element === 'string') {