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

docs: update API reference for <Script> (switch to _document.js) #61875

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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