Skip to content

Commit

Permalink
Add onLoad gottcha note to next/script docs (#33097)
Browse files Browse the repository at this point in the history
Add a note to the onLoad section of the next/script documentation clarifying that onLoad will not run if `strategy="beforeInteractive"`. (That tripped me up for a bit so I thought I'd update the docs to save any one else the hassle :).)

Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
  • Loading branch information
callumgare and leerob committed Jan 14, 2022
1 parent 613e4c9 commit 5748915
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api-reference/next/script.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The loading strategy of the script.

A method that returns additional JavaScript that should be executed after the script has finished loading.

> **Note: `onLoad` can't be used with the `beforeInteractive` loading strategy.**
The following is an example of how to use the `onLoad` property:

```jsx
Expand Down

0 comments on commit 5748915

Please sign in to comment.