import { renderToString } from "react-dom/server"; import { RemixServer } from "@remix-run/react"; import type { EntryContext } from "@remix-run/cloudflare"; import { injectStyles, createStylesServer } from "@mantine/remix"; const server = createStylesServer(); export default function handleRequest( request: Request, responseStatusCode: number, responseHeaders: Headers, remixContext: EntryContext ) { const markup = renderToString( ); responseHeaders.set("Content-Type", "text/html"); return new Response(`${injectStyles(markup, server)}`, { status: responseStatusCode, headers: responseHeaders, }); }