Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix first render of with-react-helmet example #6235

Merged

Conversation

Ephem
Copy link
Contributor

@Ephem Ephem commented Feb 10, 2019

This PR fixes #3534.

Helmet was being rendered in <Head> in _document.js. Because getInitialProps and therefor Helmet.renderStatic() gets called before the document is rendered with renderToStaticMarkup, the meta-tags inside of document would not get flushed until the next request.

I moved the default helmet-metadata into _app.js instead which gets rendered before the Helmet.renderStatic()-call. This fixed the problem.

Also did some minor cleaning up/simplification.

@timneutkens timneutkens merged commit b05df70 into vercel:canary Feb 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

with-react-helmet bug in production mode
2 participants