Unverified Commit 807d1ec7 authored by Zack Sheppard's avatar Zack Sheppard Committed by GitHub

Clarify in docs that `next/script` must not be in `next/head` (#27534)



Documentation to help future developers avoid #27498 

## Documentation / Examples

- [X] Make sure the linting passes
parent f9ebc777
...@@ -49,7 +49,11 @@ export default function Home() { ...@@ -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 ```js
// After // After
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment