You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the useDocumentHead hook to access head data (e.g. values added in the frontmatter in MDX files), we cannot directly track the head value for changes:
exportdefaultcomponent$(()=>{consthead=useDocumentHead();constauthorId=useComputed$(()=>{returnhead.meta.find((m)=>m.name==="author")?.content;// <--- ESLint not happy});// ...});
51:12 error When referencing "head" inside a different scope (useComputed$), Qwik needs to serialize the value, however "head.styles.props.ref" is a function, which is not serializable.
Check out https://qwik.dev/docs/advanced/dollar/ for more details qwik/valid-lexical-scope
✖ 1 problem (1 error, 0 warnings)
It is however possible to bypass this by simply destructuring useDocumentHead() return value directly:
Which component is affected?
Qwik City (routing)
Describe the bug
When using the
useDocumentHead
hook to access head data (e.g. values added in the frontmatter in MDX files), we cannot directly track thehead
value for changes:It is however possible to bypass this by simply destructuring
useDocumentHead()
return value directly:Reproduction
https://github.com/ianlet/qwik-head-scope-issues
Steps to reproduce
No response
System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: