MCPcopy
hub / github.com/facebook/react / useDeferredValue

Function useDeferredValue

packages/react-debug-tools/src/ReactDebugHooks.js:507–519  ·  view source on GitHub ↗
(value: T, initialValue?: T)

Source from the content-addressed store, hash-verified

505}
506
507function useDeferredValue<T>(value: T, initialValue?: T): T {
508 const hook = nextHook();
509 const prevValue = hook !== null ? hook.memoizedState : value;
510 hookLog.push({
511 displayName: null,
512 primitive: 'DeferredValue',
513 stackError: new Error(),
514 value: prevValue,
515 debugInfo: null,
516 dispatcherHookName: 'DeferredValue',
517 });
518 return prevValue;
519}
520
521function useId(): string {
522 const hook = nextHook();

Callers 5

Timeline.jsFile · 0.90
useInferredNameFunction · 0.90
AppFunction · 0.50
ContentFunction · 0.50
BFunction · 0.50

Calls 2

nextHookFunction · 0.85
pushMethod · 0.65

Tested by 3

AppFunction · 0.40
ContentFunction · 0.40
BFunction · 0.40