Skip to content

Using Nuxt composables in unhead composables (e.g. useSeoMeta) #283

Closed Answered by harlan-zw
riddla asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @riddla, with v1.8 Unhead no longer uses a shared context, which was causing issues when parallel requests came in.

To avoid this issue is quite simple and is a pattern you may use elsewhere for this issue.

// collect the refs / reactive elements first
const route = useRoute()
useSeoMeta({
   // then use within the functions
    title: () => route.meta['title'] as string,
})

Let me know if you have any further questions on it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@riddla
Comment options

Answer selected by riddla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants