Unverified Commit 44c7fd79 authored by David Barker's avatar David Barker Committed by GitHub

Add onLoad gotcha note to basic-features doc (#36261)

#33097 adds a note to the `Script` documentation explaining that `onLoad` cannot be used with the `beforeInteractive` strategy. However, this note was missing in the [Basic Features](https://nextjs.org/docs/basic-features/script) documentation, causing some confusion. This adds the note there too.

This will hopefully fix a lot of confusion noted in https://github.com/vercel/next.js/issues/33191.
parent 4a8a3d24
......@@ -256,6 +256,8 @@ export default function Home() {
}
```
> **Note: `onLoad` can't be used with the `beforeInteractive` loading strategy.**
Sometimes it is helpful to catch when a script fails to load. These errors can be handled with the `onError` property:
```jsx
......
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