Skip to content

Commit

Permalink
docs: update API reference for <Script> (switch to _document.js) (#…
Browse files Browse the repository at this point in the history
…61875)

## Changes

- Fixes #61594

Closes NEXT-2421
  • Loading branch information
samcx authored Feb 9, 2024
1 parent 8f6f137 commit 19adc81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/02-app/02-api-reference/01-components/script.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Scripts denoted with this strategy are preloaded and fetched before any first-pa

<PagesOnly>

`beforeInteractive` scripts must be placed inside the `App` Component (`pages/_app.js`) and are designed to load scripts that are needed by the entire site (i.e. the script will load when any page in the application has been loaded server-side).
`beforeInteractive` scripts must be placed inside the `Document` Component (`pages/_document.js`) and are designed to load scripts that are needed by the entire site (i.e. the script will load when any page in the application has been loaded server-side).

</PagesOnly>

Expand Down Expand Up @@ -126,7 +126,7 @@ export default function RootLayout({ children }) {

<PagesOnly>

```jsx filename="pages/_app.js"
```jsx filename="pages/_document.js"
import { Html, Head, Main, NextScript } from 'next/document'
import Script from 'next/script'

Expand Down

0 comments on commit 19adc81

Please sign in to comment.