diff --git a/isp-site/src/index.js b/isp-site/src/index.js index 57600e28..ff2245bd 100644 --- a/isp-site/src/index.js +++ b/isp-site/src/index.js @@ -92,7 +92,7 @@ routes.push({ const router = createHashRouter(routes); -const root = ReactDOM.createRoot(document.getElementById("root")).render( +ReactDOM.createRoot(document.getElementById("root")).render( diff --git a/isp-site/src/routes/markdown.jsx b/isp-site/src/routes/markdown.jsx index 700b3189..0a59de26 100644 --- a/isp-site/src/routes/markdown.jsx +++ b/isp-site/src/routes/markdown.jsx @@ -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"; @@ -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( - , - branch, - ); - }); + if (branches.length > 0) { + for (const branch of branches) { + Explorer(page, branch, l).then((table) => { + ReactDOM.createRoot(branch).render( + , + ); + }); + } } });