qwik
qwik copied to clipboard
DocumentHead - title is not working
Qwik Version
0.9.0
Operating System (or Browser)
Chrome
Node Version (if applicable)
16.16.0
Which component is affected?
Qwik City
Expected Behaviour
When using DocumentHead and setting title page title should be updated to the title string
Actual Behaviour
When using DocumentHead and setting title page is not working.
Additional Information
` import { component$, useClientEffect$, useStore, } from "@builder.io/qwik"; import type { DocumentHead } from "@builder.io/qwik-city";
export default component$(() => { const store = useStore({ count: 1, start: false, });
useClientEffect$(({ track, cleanup }) => { track(store, "start"); console.log("Starting clock"); if (!store.start) return; const timer = setInterval(() => { store.count++; }, 400);
cleanup(() => {
clearInterval(timer);
});
});
return (
Count : {store.count}
<button onClick$={() => { store.start = true; }} > Startexport const head: DocumentHead = { title: "Welcome to Qwik", }; `
above is the code i'm using

Can you please provide a repo case? stackblitz.com link can work!
Sorry I'm un able to reproduce this error. It may be that DocumentHead is only being used on a component, and not a qwik-city page. Closing for now, please reopen if you're still facing issues.
I did run into this as well. For anyone looking at this in the future: Make sure your RouterHead
component uses f.ex. head.title
from the useDocumentHead
hook.