MCPcopy Index your code
hub / github.com/react/react / useId

Function useId

packages/react-debug-tools/src/ReactDebugHooks.js:521–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519}
520
521function useId(): string {
522 const hook = nextHook();
523 const id = hook !== null ? hook.memoizedState : '';
524 hookLog.push({
525 displayName: null,
526 primitive: 'Id',
527 stackError: new Error(),
528 value: id,
529 debugInfo: null,
530 dispatcherHookName: 'Id',
531 });
532 return id;
533}
534
535// useMemoCache is an implementation detail of Forget's memoization
536// it should not be called directly in user-generated code

Callers 5

DivWithIdFunction · 0.50
ChildFunction · 0.50
AppFunction · 0.50
BarFunction · 0.50
ParentFunction · 0.50

Calls 2

nextHookFunction · 0.85
pushMethod · 0.65

Tested by 5

DivWithIdFunction · 0.40
ChildFunction · 0.40
AppFunction · 0.40
BarFunction · 0.40
ParentFunction · 0.40