Skip to content

Commit 78324eb

Browse files
authored
chore(docs): Add wrapRootElement limitation to off-main-thread (#37402)
1 parent 20ce44b commit 78324eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/docs/reference/built-in-components/gatsby-script.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,13 @@ You may need to adjust your dev tools to the verbose log level in order to see t
324324

325325
By leveraging [Partytown](https://partytown.builder.io), scripts that use the `off-main-thread` strategy must also be aware of the [limitations mentioned in the Partytown documentation](https://partytown.builder.io/trade-offs). While the strategy can be powerful, it may not be the best solution for all scenarios.
326326

327-
In addition, there are other limitations that require upstream changes from Partytown to enable:
327+
These limitations require upstream changes from Partytown to enable:
328328

329329
- The `onLoad` and `onError` callbacks are not supported. See [discussion #199 in the Partytown repo](https://github.com/BuilderIO/partytown/discussions/199).
330330
- Scripts load only on server-side rendering (SSR) navigation (e.g. regular `<a>` tag navigation), and not on client-side rendering (CSR) navigation (e.g. Gatsby `<Link>` navigation). See [issue #74 in the Partytown repo](https://github.com/BuilderIO/partytown/issues/74).
331331

332+
In addition, the `off-main-thread` strategy cannot be used in the `wrapRootElement` API since script collection depends on location providers. Use the `wrapPageElement` API instead.
333+
332334
## Usage in Gatsby SSR and Browser APIs
333335

334336
The Gatsby `<Script>` component can also be used in the following [Gatsby SSR](/docs/reference/config-files/gatsby-ssr/) and [Gatsby Browser](/docs/reference/config-files/gatsby-browser/) APIs:

0 commit comments

Comments
 (0)