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

Function useCallback

packages/react-debug-tools/src/ReactDebugHooks.js:432–443  ·  view source on GitHub ↗
(callback: T, inputs: Array<mixed> | void | null)

Source from the content-addressed store, hash-verified

430}
431
432function useCallback<T>(callback: T, inputs: Array<mixed> | void | null): T {
433 const hook = nextHook();
434 hookLog.push({
435 displayName: null,
436 primitive: 'Callback',
437 stackError: new Error(),
438 value: hook !== null ? hook.memoizedState[0] : callback,
439 debugInfo: null,
440 dispatcherHookName: 'Callback',
441 });
442 return callback;
443}
444
445function useMemo<T>(
446 nextCreate: () => T,

Callers 15

StatefulFunctionFunction · 0.90
index.jsFile · 0.90
List.jsFile · 0.90
ListItemFunction · 0.90
FunctionWithHooksFunction · 0.90
CanvasPage.jsFile · 0.90
ListItemFunction · 0.90
ToDoList.jsFile · 0.90
ToggleFunction · 0.90
TabBarFunction · 0.90
useLocalStorageFunction · 0.90
useHighlightHostInstanceFunction · 0.90

Calls 2

nextHookFunction · 0.85
pushMethod · 0.65

Tested by 3

ListItemFunction · 0.72
CounterFunction · 0.40
CapitalizedTextFunction · 0.40