Skip to content

Commit 7b5ba15

Browse files
authored
[react] Rename unstable_expectedLoadTime to defer in Suspense (#74061)
1 parent ed44b07 commit 7b5ba15

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

types/react/experimental.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
4343

4444
declare module "." {
4545
export interface SuspenseProps {
46+
// @enableCPUSuspense
4647
/**
4748
* The presence of this prop indicates that the content is computationally expensive to render.
4849
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
4950
* @see {@link https://github.com/facebook/react/pull/19936}
5051
*/
51-
unstable_expectedLoadTime?: number | undefined;
52+
defer?: boolean | undefined;
5253
}
5354

5455
export type SuspenseListRevealOrder = "forwards" | "backwards" | "together" | "independent";

types/react/test/experimental.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function suspenseTest() {
1515

1616
function FlameChart() {
1717
return (
18-
<React.Suspense fallback="computing..." unstable_expectedLoadTime={2000}>
18+
<React.Suspense fallback="computing..." defer>
1919
<DisplayData />
2020
</React.Suspense>
2121
);

types/react/ts5.0/experimental.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
4343

4444
declare module "." {
4545
export interface SuspenseProps {
46+
// @enableCPUSuspense
4647
/**
4748
* The presence of this prop indicates that the content is computationally expensive to render.
4849
* In other words, the tree is CPU bound and not I/O bound (e.g. due to fetching data).
4950
* @see {@link https://github.com/facebook/react/pull/19936}
5051
*/
51-
unstable_expectedLoadTime?: number | undefined;
52+
defer?: boolean | undefined;
5253
}
5354

5455
export type SuspenseListRevealOrder = "forwards" | "backwards" | "together" | "independent";

types/react/ts5.0/test/experimental.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function suspenseTest() {
1515

1616
function FlameChart() {
1717
return (
18-
<React.Suspense fallback="computing..." unstable_expectedLoadTime={2000}>
18+
<React.Suspense fallback="computing..." defer>
1919
<DisplayData />
2020
</React.Suspense>
2121
);

0 commit comments

Comments
 (0)