Skip to content

Can i get page context from createPage() in onRenderBody? #27490

Answered by herecydev
mrkmx asked this question in Help
Discussion options

You must be logged in to vote

I think the onRenderBody method isn't suitable for what you want. You don't have access to the pageProps or the ability to run any graphql queries. It would be much simpler to use react-helmet. You can put this into your pages, get the information from the graphql data and let react helmet build up the correct head components. This will also be statically generated as well 👍

Replies: 3 comments 1 reply

Comment options

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

Answer selected by LekoArts
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #27490 on October 16, 2020 10:37.