Skip to content

Commit

Permalink
fix: fix useConfig() for {body,html}Attributes (vikejs/vike-vue#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 14, 2024
1 parent bb01200 commit 653b808
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/vike-react/src/renderer/onRenderHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ import { getTagAttributesString, type TagAttributes } from '../utils/getTagAttri

addEcosystemStamp()

const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType<OnRenderHtmlAsync> => {
const onRenderHtml: OnRenderHtmlAsync = async (
pageContext: PageContextServer & PageContextInternal
): ReturnType<OnRenderHtmlAsync> => {
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`<!DOCTYPE html>
<html${dangerouslySkipEscape(htmlAttributesString)}>
<head>
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 653b808

Please sign in to comment.