why
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { renderToString } from "react-dom/server"
|
|
||||||
import type { EntryContext } from "@remix-run/node"
|
import type { EntryContext } from "@remix-run/node"
|
||||||
import { RemixServer } from "@remix-run/react"
|
import * as remixRunReact from "@remix-run/react"
|
||||||
|
import { renderToString } from "react-dom/server"
|
||||||
|
|
||||||
export default function handleRequest(
|
export default function handleRequest(
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -9,7 +9,9 @@ export default function handleRequest(
|
|||||||
remixContext: EntryContext,
|
remixContext: EntryContext,
|
||||||
) {
|
) {
|
||||||
const markup = renderToString(
|
const markup = renderToString(
|
||||||
<RemixServer context={remixContext} url={request.url} />,
|
// for some reason, a named import becomes `undefined` here,
|
||||||
|
// a namespace import makes it work...? 🙃
|
||||||
|
<remixRunReact.RemixServer context={remixContext} url={request.url} />,
|
||||||
)
|
)
|
||||||
|
|
||||||
responseHeaders.set("Content-Type", "text/html")
|
responseHeaders.set("Content-Type", "text/html")
|
||||||
|
|||||||
Reference in New Issue
Block a user