From c4a0168861156e198443997ab8a2f519405fc36b Mon Sep 17 00:00:00 2001 From: Maik Jablonski Date: Sat, 28 Oct 2023 09:35:31 +0000 Subject: [PATCH] Use deprecated ReactDOM.render as it is the only stable to avoid race conditions --- index.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/index.js b/index.js index c0181c0..df46b8a 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ import React from "react"; import ReactDOM from "react-dom"; -import { createRoot } from "react-dom/client"; import JsxParser from "react-jsx-parser"; export let TEMPLATING_ERROR = //; @@ -19,15 +18,7 @@ export function render(components, root, callback) { callback(); } }; - if ( - navigator.userAgent.includes("Safari") && - !navigator.userAgent.includes("Chrome") - ) { - ReactDOM.render(parse(components, root), root, restoreCallback); - } else { - createRoot(root).render(parse(components, root)); - setTimeout(restoreCallback, 0); - } + ReactDOM.render(parse(components, root), root, restoreCallback); } }