`replaceRenderer` is not called in a dev build
nadiia opened this issue · comments
It calls the replaceRenderer
method only in a production build but not in development.
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.
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.