Skip to content

Commit

Permalink
use createRoot() for node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
thedannywahl committed Feb 16, 2024
1 parent 5cab471 commit 2a32d33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion isp-site/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ routes.push({

const router = createHashRouter(routes);

const root = ReactDOM.createRoot(document.getElementById("root")).render(
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<InstUISettingsProvider theme={canvas}>
<View as="div" minHeight="100vh" position="relative">
Expand Down
29 changes: 15 additions & 14 deletions isp-site/src/routes/markdown.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Modules
import React, { useState, useEffect } from "react";
import reactDOM from "react-dom";
import * as ReactDOM from "react-dom/client";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkGemoji from "remark-gemoji";
Expand Down Expand Up @@ -56,19 +56,20 @@ export default function Markdown({ readme }) {
const page = document.getElementsByTagName("body")[0].classList[0];
const branches = document.querySelectorAll(".markdown .contents");

for (const branch of branches) {
Explorer(page, branch, l).then((table) => {
reactDOM.render(
<ReactMarkdown
children={table}
remarkPlugins={[remarkGfm, remarkGemoji]}
rehypePlugins={[rehypeRaw]}
allowedElements={allowedElements}
components={mdtoui}
/>,
branch,
);
});
if (branches.length > 0) {
for (const branch of branches) {
Explorer(page, branch, l).then((table) => {
ReactDOM.createRoot(branch).render(
<ReactMarkdown
children={table}
remarkPlugins={[remarkGfm, remarkGemoji]}
rehypePlugins={[rehypeRaw]}
allowedElements={allowedElements}
components={mdtoui}
/>,
);
});
}
}
});

Expand Down

0 comments on commit 2a32d33

Please sign in to comment.