Skip to content

Commit 73bd191

Browse files
committed
[DevTools] fix useDeferredValue to match reconciler change
1 parent 522f473 commit 73bd191

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/react-debug-tools/src/ReactDebugHooks.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,11 @@ function useTransition(): [
310310
}
311311

312312
function useDeferredValue<T>(value: T): T {
313-
// useDeferredValue() composes multiple hooks internally.
314-
// Advance the current hook index the same number of times
315-
// so that subsequent hooks have the right memoized state.
316-
nextHook(); // State
317-
nextHook(); // Effect
313+
const hook = nextHook();
318314
hookLog.push({
319315
primitive: 'DeferredValue',
320316
stackError: new Error(),
321-
value,
317+
value: hook !== null ? hook.memoizedState[0] : value,
322318
});
323319
return value;
324320
}

0 commit comments

Comments
 (0)