( initialState: (() => S) | S, )
| 343 | } |
| 344 | |
| 345 | export function useState<S>( |
| 346 | initialState: (() => S) | S, |
| 347 | ): [S, Dispatch<BasicStateAction<S>>] { |
| 348 | if (__DEV__) { |
| 349 | currentHookNameInDev = 'useState'; |
| 350 | } |
| 351 | return useReducer( |
| 352 | basicStateReducer, |
| 353 | // useReducer has a special case to support lazy useState initializers |
| 354 | (initialState: any), |
| 355 | ); |
| 356 | } |
| 357 | |
| 358 | export function useReducer<S, I, A>( |
| 359 | reducer: (S, A) => S, |
nothing calls this directly
no test coverage detected