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

replaceRenderer is not called in a dev build #3166

Closed
nadiia opened this issue Dec 8, 2017 · 2 comments
Closed

replaceRenderer is not called in a dev build #3166

nadiia opened this issue Dec 8, 2017 · 2 comments

Comments

@nadiia
Copy link
Contributor

nadiia commented Dec 8, 2017

It calls the replaceRenderer method only in a production build but not in development.

@nadiia nadiia changed the title replaceRenderer is not called in the dev mode replaceRenderer is not called in the dev build Dec 8, 2017
@nadiia nadiia changed the title replaceRenderer is not called in the dev build replaceRenderer is not called in a dev build Dec 8, 2017
@benjaminhoffman
Copy link
Contributor

I think this is expected behaviour? When I want to test something in my gatsby-ssr file, I simply run gatsby build then gatsby serve. Then you will see your changes. From the docs for onRenderBody:

Called after every page Gatsby server renders while building HTML so you can set head and body components to be rendered in your html.js.

Gatsby does a two-pass render for HTML. It loops through your pages first rendering only the body and then takes the result body HTML string and passes it as the body prop to your html.js to complete the render.

link: https://www.gatsbyjs.org/docs/ssr-apis/

@KyleAMathews
Copy link
Contributor

Yeah, during development only the HTML component is rendered and not any page body components as we just do that client side. @benjaminhoffman's explanation is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants