Skip to content

Commit ea319e7

Browse files
committed
docs(react-dom): fix async and defer script attribute descriptions
Fixes #7328
1 parent e9a7cb1 commit ea319e7

File tree

1 file changed

+2
-2
lines changed
  • src/content/reference/react-dom/components

1 file changed

+2
-2
lines changed

src/content/reference/react-dom/components/script.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ It should have *either* `children` or a `src` prop.
4040

4141
Other supported props:
4242

43-
* `async`: a boolean. Allows the browser to defer execution of the script until the rest of the document has been processed — the preferred behavior for performance.
43+
* `async`: a boolean. Allows the browser to download the script in parallel and execute it as soon as it's available, potentially interrupting the document parsing — the preferred behavior for performance.
4444
* `crossOrigin`: a string. The [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use. Its possible values are `anonymous` and `use-credentials`.
4545
* `fetchPriority`: a string. Lets the browser rank scripts in priority when fetching multiple scripts at the same time. Can be `"high"`, `"low"`, or `"auto"` (the default).
4646
* `integrity`: a string. A cryptographic hash of the script, to [verify its authenticity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
@@ -57,7 +57,7 @@ Props that disable React's [special treatment of scripts](#special-rendering-beh
5757
Props that are **not recommended** for use with React:
5858

5959
* `blocking`: a string. If set to `"render"`, instructs the browser not to render the page until the scriptsheet is loaded. React provides more fine-grained control using Suspense.
60-
* `defer`: a string. Prevents the browser from executing the script until the document is done loading. Not compatible with streaming server-rendered components. Use the `async` prop instead.
60+
* `defer`: a boolean. Downloads the script in parallel but defers execution until the document has finished parsing. Not compatible with streaming server-rendered components. Use the `async` prop instead.
6161

6262
#### Special rendering behavior {/*special-rendering-behavior*/}
6363

0 commit comments

Comments
 (0)