Skip to content

Commit

Permalink
fixes #1373 - removed top-level await in order to resolve the error…
Browse files Browse the repository at this point in the history
…: "await is only valid in async functions and the top level bodies of modules"
  • Loading branch information
yairEO committed Oct 24, 2024
1 parent 0b2a55a commit b0b16d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/react-compat-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -16,7 +16,7 @@ async function initReact() {
}
}

await initReact();
initReact();

function renderToStaticMarkup(element) {
if (typeof element === 'string') {
Expand Down

0 comments on commit b0b16d3

Please sign in to comment.