diff --git a/client/src/js/main/main.tsx b/client/src/js/main/main.tsx index 1f50f45..e0f9231 100644 --- a/client/src/js/main/main.tsx +++ b/client/src/js/main/main.tsx @@ -7,33 +7,34 @@ import { Task } from "~/components/Task"; (function () { const components = { - "react-newtask": ( + "react-newtask": () => ( ), - "react-edittask": ( + "react-edittask": () => ( ), - "react-tasks": ( + "react-tasks": () => ( ), - "react-projects": ( + "react-projects": () => ( ) }; - Object - .entries(components) - .forEach(([name, jsx]) => { - const root = document.querySelector(`.${name}`); - if (root) { - ReactDOM.createRoot(root).render(jsx); - } - }); + const ents = Object.entries(components); + for (let i = 0; i < ents.length; i++) { + const [name, getJSX] = ents[i]; + const root = document.querySelector(`.${name}`); + if (root) { + ReactDOM.createRoot(root).render(getJSX()); + break; + } + } })();