I'm very new to deno and quite enjoy it's advantages over node. I'm trying to set up react ssr with deno but am encountering the following error. ( image one )
This is my router with oak ( within file named index.tsx )
router
.get("/", async (ctx) => {
const html = await renderToString(<Display />);
ctx.response.type = "text/html";
ctx.response.body = html;
})
and this is my display,tsx
import React, { useState } from "https://esm.sh/react@18.2.0"
export default function Display() {
let [ count, setCount ] = useState(0);
return (
<>
<h1>Welcome to my app!</h1>
<button onClick={() => setCount(count + 1)}>Count: { count }</button>
</>
)
}
I've had this error for quite some time and it has increasingly become a roadblock to set up react ssr with deno.
Any help or discussion would be greatly appreciated.