vikejs/vike-react

Title is being set to an empty string on client-side navigation with SSR

Closed this issue · 1 comments

Hey! I noticed that on this personal project of mine my <title> tag is getting emptied each time on client-side navigation. I only have a +Head.tsx file defined at root so should't be overridden by any page.

Digging into the onRenderClient.tsx I noticed that the title var that comes from the pageContext.configEntries is being set to an empty string if it returns a falsy value, so it always updates the head <title> tag. Wondering if it's safe removing this || '' at the end of the line.

https://github.com/vikejs/vike-react/blob/bdf9e088902821e14e6bf76fcb6a9769347392fd/packages/vike-react/src/renderer/onRenderClient.tsx#L59C53-L59C59

Fix pre-released as 0.4.18-commit-5c88c7b.

In case your company is up for it, we're looking for sponsors (vikejs/vike#1350).