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

Function useMemo

packages/react-reconciler/src/ReactFiberHooks.js:4064–4075  ·  view source on GitHub ↗
(create: () => T, deps: Array<mixed> | void | null)

Source from the content-addressed store, hash-verified

4062 return mountLayoutEffect(create, deps);
4063 },
4064 useMemo<T>(create: () => T, deps: Array<mixed> | void | null): T {
4065 currentHookNameInDev = 'useMemo';
4066 mountHookTypesDev();
4067 checkDepsAreArrayDev(deps);
4068 const prevDispatcher = ReactSharedInternals.H;
4069 ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV;
4070 try {
4071 return mountMemo(create, deps);
4072 } finally {
4073 ReactSharedInternals.H = prevDispatcher;
4074 }
4075 },
4076 useReducer<S, I, A>(
4077 reducer: (S, A) => S,
4078 initialArg: I,

Callers 9

CapitalizedTextFunction · 0.50
LazyComputeFunction · 0.50
AppFunction · 0.50
BadUseMemoFunction · 0.50
ExcitingTextFunction · 0.50
AppFunction · 0.50
useManualMemoFunction · 0.50
AppShellFunction · 0.50

Calls

no outgoing calls

Tested by 8

CapitalizedTextFunction · 0.40
LazyComputeFunction · 0.40
AppFunction · 0.40
BadUseMemoFunction · 0.40
ExcitingTextFunction · 0.40
AppFunction · 0.40
useManualMemoFunction · 0.40
AppShellFunction · 0.40