Function
useReducer
(
reducer: (S, A) => S,
initialArg: I,
init?: I => S,
)
Source from the content-addressed store, hash-verified
| 4074 | } |
| 4075 | }, |
| 4076 | useReducer<S, I, A>( |
| 4077 | reducer: (S, A) => S, |
| 4078 | initialArg: I, |
| 4079 | init?: I => S, |
| 4080 | ): [S, Dispatch<A>] { |
| 4081 | currentHookNameInDev = 'useReducer'; |
| 4082 | mountHookTypesDev(); |
| 4083 | const prevDispatcher = ReactSharedInternals.H; |
| 4084 | ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; |
| 4085 | try { |
| 4086 | return mountReducer(reducer, initialArg, init); |
| 4087 | } finally { |
| 4088 | ReactSharedInternals.H = prevDispatcher; |
| 4089 | } |
| 4090 | }, |
| 4091 | useRef<T>(initialValue: T): {current: T} { |
| 4092 | currentHookNameInDev = 'useRef'; |
| 4093 | mountHookTypesDev(); |