()
| 300 | |
| 301 | // Reset the internal hooks state if an error occurs while rendering a component |
| 302 | export function resetHooksState(): void { |
| 303 | if (__DEV__) { |
| 304 | isInHookUserCodeInDev = false; |
| 305 | } |
| 306 | |
| 307 | currentlyRenderingComponent = null; |
| 308 | currentlyRenderingTask = null; |
| 309 | currentlyRenderingRequest = null; |
| 310 | currentlyRenderingKeyPath = null; |
| 311 | didScheduleRenderPhaseUpdate = false; |
| 312 | firstWorkInProgressHook = null; |
| 313 | numberOfReRenders = 0; |
| 314 | renderPhaseUpdates = null; |
| 315 | workInProgressHook = null; |
| 316 | } |
| 317 | |
| 318 | function readContext<T>(context: ReactContext<T>): T { |
| 319 | if (__DEV__) { |
no outgoing calls
no test coverage detected