Skip to content

Commit

Permalink
Clarify html.js vs. onPreRenderHTML (#34203)
Browse files Browse the repository at this point in the history
* Clarify html.js vs. onPreRenderHTML

Clarify a note that adding a script via html.js is the same as using onPreRenderHTML.

* chore: format

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
  • Loading branch information
graysonhicks and gatsbybot committed Dec 6, 2021
1 parent a442b2d commit c85a707
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/how-to/performance/improving-site-performance.md
Expand Up @@ -79,7 +79,7 @@ There are a number of places to put an inlined script, depending whether you nee
- _Some deferring_: You can place the script in [onClientEntry](/docs/browser-apis/#onClientEntry) to have it execute after page load, but before the browser renders the page.
- _More deferring_: You can place the script in [onInitialClientRender](/docs/browser-apis/#onInitialClientRender) to have it execute after the browser renders the page.

Note that if you are using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`.
Note that if you are already using [html.js](/docs/custom-html/), you should modify that file to include your snippet instead of using `onPreRenderHTML`. This will have the same behavior.

### Reduce your JavaScript bundle cost

Expand Down

0 comments on commit c85a707

Please sign in to comment.