From aff6f9b99d4bb5d0b309fe3ac9f55fd3d71682a7 Mon Sep 17 00:00:00 2001 From: Dominik Piatek Date: Wed, 13 Dec 2023 17:56:03 +0000 Subject: [PATCH] fixup! Remove ably-ui gem building and release tools --- scripts/setup-modules.js | 4 ---- src/core/react-renderer.js | 11 +++++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/setup-modules.js b/scripts/setup-modules.js index 770b9da68..de8a78679 100755 --- a/scripts/setup-modules.js +++ b/scripts/setup-modules.js @@ -113,15 +113,11 @@ const sync = ({ verbose } = { verbose: false }) => { log(""); modules.forEach((mod) => { - copyCompiledModuleAssets(mod); copyFonts(mod); copyImages(mod); - copyIconSprites(mod); createGitignoreFiles(mod); mod.components.forEach((componentName) => { - copyComponentTemplates(mod, componentName); - copyCompiledComponentAssets(mod, componentName); copyComponentData(mod, componentName); }); }); diff --git a/src/core/react-renderer.js b/src/core/react-renderer.js index d01857255..2f2cbc9fc 100644 --- a/src/core/react-renderer.js +++ b/src/core/react-renderer.js @@ -1,9 +1,11 @@ import React from "react"; -import ReactDOM from "react-dom"; +import { createRoot } from 'react-dom/client'; -const renderComponent = (Component, props, node) => +const renderComponent = (Component, props, node) => { + const root = createRoot(node); // eslint-disable-next-line react/no-render-return-value - ReactDOM.render(, node); + root.render(); +} export { renderComponent }; @@ -19,7 +21,8 @@ export default function reactRenderer(components) { const propsJson = node.getAttribute("data-react-props"); const props = propsJson && JSON.parse(propsJson || {}); - ReactDOM.render(, node); + const root = createRoot(node); + root.render(); node.removeAttribute("data-react"); node.removeAttribute("data-react-props");