Skip to content

Commit

Permalink
fix[devtools/updateFiberRecursively]: mount suspense fallback set in …
Browse files Browse the repository at this point in the history
…timed-out case
  • Loading branch information
hoxyq committed Jul 25, 2023
1 parent 587ae49 commit 8bee920
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,18 @@ export function attach(
const prevFallbackChildSet = prevFiberChild
? prevFiberChild.sibling
: null;

if (prevFallbackChildSet == null && nextFallbackChildSet != null) {
mountFiberRecursively(
nextFallbackChildSet,
shouldIncludeInTree ? nextFiber : parentFiber,
true,
traceNearestHostComponentUpdate,
);

shouldResetChildren = true;
}

if (
nextFallbackChildSet != null &&
prevFallbackChildSet != null &&
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-shared/src/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export function installHook(target: any): DevToolsHook | null {

let uidCounter = 0;

function inject(renderer: ReactRenderer) {
function inject(renderer: ReactRenderer): number {
const id = ++uidCounter;
renderers.set(id, renderer);

Expand Down
1 change: 1 addition & 0 deletions packages/react-reconciler/src/ReactFiberDevToolsHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function injectInternals(internals: Object): boolean {
// No DevTools
return false;
}

const hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (hook.isDisabled) {
// This isn't a real property on the hook, but it can be set to opt out
Expand Down

0 comments on commit 8bee920

Please sign in to comment.