Skip to content

Commit 217b2cc

Browse files
authored
[Fiber] render boundary in fallback if it contains a new stylesheet during sync update (#28965)
Updates Suspensey instances and resources to preload even during urgent updates and to potentially suspend. The current implementation is unchanged for transitions but for sync updates if there is a suspense boundary above the resource/instance it will be rendered in fallback mode instead. Note: This behavior is not what we want for images once we make them suspense enabled. We will need to have forked behavior here to distinguish between stylesheets which should never commit when not loaded and images which should commit after a small delay
1 parent 0f58454 commit 217b2cc

File tree

8 files changed

+495
-104
lines changed

8 files changed

+495
-104
lines changed

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,6 @@ export function mayResourceSuspendCommit(resource: Resource): boolean {
31543154
}
31553155

31563156
export function preloadInstance(type: Type, props: Props): boolean {
3157-
// Return true to indicate it's already loaded
31583157
return true;
31593158
}
31603159

@@ -3163,10 +3162,11 @@ export function preloadResource(resource: Resource): boolean {
31633162
resource.type === 'stylesheet' &&
31643163
(resource.state.loading & Settled) === NotLoaded
31653164
) {
3166-
// we have not finished loading the underlying stylesheet yet.
3165+
// Return false to indicate this resource should suspend
31673166
return false;
31683167
}
3169-
// Return true to indicate it's already loaded
3168+
3169+
// Return true to indicate this resource should not suspend
31703170
return true;
31713171
}
31723172

0 commit comments

Comments
 (0)