So I have a package built that just renders a react node to an element on screen.
Built with Vite.
Now I want to use it in an html file like so but I have a hard time trying to find how to actually get it to call the function from my package created.
All I want to do is create a simple package that I can then host somewhere, import it into another site I have and run the code there.
What am I doing wrong?
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script type="script" src="C:UsersMyselfDocumentsprojectsTryoutPOCdistindex.umd.cjs"></script>
</head>
<body>
<div id="root"></div>
<script>
// renderMyPage("root") // ??? how do I run this?
</script>
</body>
</html>
Main.tsx
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
const renderMyPage = (rootId: string) => {
createRoot(document.getElementById(rootId)!).render(
<StrictMode>
<App />
</StrictMode>
);
};
// renderMyPage("root")
export { renderMyPage }