Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Clarify in docs that next/script must not be in next/head (vercel…
Browse files Browse the repository at this point in the history
…#27534)

Documentation to help future developers avoid vercel#27498 

## Documentation / Examples

- [X] Make sure the linting passes
  • Loading branch information
zackdotcomputer authored Aug 1, 2021
1 parent e6bcdf6 commit bfd3b55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/basic-features/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export default function Home() {
}
```

With `next/script`, you no longer need to wrap scripts in `next/head`. Further, `next/script` should **not** be used in `pages/_document.js` as `next/script` has client-side functionality to ensure loading order. For example:
Now, you use `next/script` in the body of your Next.js page. It has client-side functionality that decides when and how to load the remote script based on the `strategy`.

> **Note:**
>
> - `next/script` **must not** be placed in either a `next/head` component or in `pages/_document.js`.
```js
// After
Expand Down

0 comments on commit bfd3b55

Please sign in to comment.