(context: ReactContext<T>)
| 265 | } |
| 266 | |
| 267 | function useContext<T>(context: ReactContext<T>): T { |
| 268 | const value = readContext(context); |
| 269 | hookLog.push({ |
| 270 | displayName: context.displayName || null, |
| 271 | primitive: 'Context', |
| 272 | stackError: new Error(), |
| 273 | value: value, |
| 274 | debugInfo: null, |
| 275 | dispatcherHookName: 'Context', |
| 276 | }); |
| 277 | return value; |
| 278 | } |
| 279 | |
| 280 | function useState<S>( |
| 281 | initialState: (() => S) | S, |