Skip to content

Commit

Permalink
docs: add await for renderSSRHead
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jan 18, 2024
1 parent b151291 commit 11a7cc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/content/1.setup/2.ssr/1.templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const head = createHead()

head.push({ title: 'Hello World ' })

const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(head)
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head)

return `
<!DOCTYPE html>
Expand Down
5 changes: 3 additions & 2 deletions docs/content/api/2.render/render-ssr-head.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Render Unhead to a string that be can be server side rendered.
**Type:**

```ts
function renderSSRHead<T extends {}>(head: Unhead<T>): SSRHeadPayload
function renderSSRHead<T extends {}>(head: Unhead<T>): Promise<SSRHeadPayload>
```

```ts
Expand All @@ -33,7 +33,8 @@ const head = createHead()
head.push({ title: 'Hello World ' })
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = renderSSRHead(head)
// requires top-level await
const { headTags, bodyTags, bodyTagsOpen, htmlAttrs, bodyAttrs } = await renderSSRHead(head)
return `
<!DOCTYPE html>
Expand Down

0 comments on commit 11a7cc1

Please sign in to comment.