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

Function useState

packages/react/src/ReactHooks.js:66–71  ·  view source on GitHub ↗
(
  initialState: (() => S) | S,
)

Source from the content-addressed store, hash-verified

64}
65
66export function useState<S>(
67 initialState: (() => S) | S,
68): [S, Dispatch<BasicStateAction<S>>] {
69 const dispatcher = resolveDispatcher();
70 return dispatcher.useState(initialState);
71}
72
73export function useReducer<S, I, A>(
74 reducer: (S, A) => S,

Callers 15

App.jsFile · 0.90
ContentFunction · 0.90
ThemeToggleButtonFunction · 0.90
ContentFunction · 0.90
ShellFunction · 0.90
ShellFunction · 0.90
AppFunction · 0.90
Page.jsFile · 0.90
useTimerFunction · 0.90
App.jsFile · 0.90
AppFunction · 0.50
useUserSpaceSubscriptionFunction · 0.50

Calls 1

resolveDispatcherFunction · 0.70

Tested by 3

AppFunction · 0.40
useUserSpaceSubscriptionFunction · 0.40
AppFunction · 0.40