diff --git a/packages/vike-react/src/renderer/onRenderHtml.tsx b/packages/vike-react/src/renderer/onRenderHtml.tsx index d62c96d7..2832e07e 100644 --- a/packages/vike-react/src/renderer/onRenderHtml.tsx +++ b/packages/vike-react/src/renderer/onRenderHtml.tsx @@ -16,13 +16,18 @@ import { getTagAttributesString, type TagAttributes } from '../utils/getTagAttri addEcosystemStamp() -const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType => { +const onRenderHtml: OnRenderHtmlAsync = async ( + pageContext: PageContextServer & PageContextInternal +): ReturnType => { const pageHtml = await getPageHtml(pageContext) const headHtml = getHeadHtml(pageContext) const { htmlAttributesString, bodyAttributesString } = getTagAttributes(pageContext) + // Not needed on the client-side, thus we remove it to save KBs sent to the client + delete pageContext._configFromHook + return escapeInject` @@ -90,9 +95,6 @@ function getHeadHtml(pageContext: PageContextServer & PageContextInternal) { .join('\n') ) - // Not needed on the client-side, thus we remove it to save KBs sent to the client - delete pageContext._configFromHook - const headHtml = escapeInject` ${titleTags} ${viewportTag}