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

Function useReducer

packages/react/src/ReactHooks.js:73–80  ·  view source on GitHub ↗
(
  reducer: (S, A) => S,
  initialArg: I,
  init?: I => S,
)

Source from the content-addressed store, hash-verified

71}
72
73export function useReducer<S, I, A>(
74 reducer: (S, A) => S,
75 initialArg: I,
76 init?: I => S,
77): [S, Dispatch<A>] {
78 const dispatcher = resolveDispatcher();
79 return dispatcher.useReducer(reducer, initialArg, init);
80}
81
82export function useRef<T>(initialValue: T): {current: T} {
83 const dispatcher = resolveDispatcher();

Callers 6

ComponentFunction · 0.90
FooFunction · 0.90
fFunction · 0.90
ComponentFunction · 0.90
StoreProviderFunction · 0.90
AppFunction · 0.50

Calls 1

resolveDispatcherFunction · 0.70

Tested by 5

ComponentFunction · 0.72
FooFunction · 0.72
fFunction · 0.72
ComponentFunction · 0.72
AppFunction · 0.40