Unverified Commit 59ea4e6a authored by 琚致远 / Zhiyuan Ju's avatar 琚致远 / Zhiyuan Ju Committed by GitHub

docs: added missing strategy (#45584)

Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent b2ac41c7
...@@ -143,7 +143,7 @@ There are a number of trade-offs that need to be considered when loading a third ...@@ -143,7 +143,7 @@ There are a number of trade-offs that need to be considered when loading a third
Inline scripts, or scripts not loaded from an external file, are also supported by the Script component. They can be written by placing the JavaScript within curly braces: Inline scripts, or scripts not loaded from an external file, are also supported by the Script component. They can be written by placing the JavaScript within curly braces:
```jsx ```jsx
<Script id="show-banner"> <Script id="show-banner" strategy="afterInteractive">
{`document.getElementById('banner').classList.remove('hidden')`} {`document.getElementById('banner').classList.remove('hidden')`}
</Script> </Script>
``` ```
...@@ -153,6 +153,7 @@ Or by using the `dangerouslySetInnerHTML` property: ...@@ -153,6 +153,7 @@ Or by using the `dangerouslySetInnerHTML` property:
```jsx ```jsx
<Script <Script
id="show-banner" id="show-banner"
strategy="afterInteractive"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: `document.getElementById('banner').classList.remove('hidden')`, __html: `document.getElementById('banner').classList.remove('hidden')`,
}} }}
......
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