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

Function resetHooksState

packages/react-server/src/ReactFizzHooks.js:302–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300
301// Reset the internal hooks state if an error occurs while rendering a component
302export 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
318function readContext<T>(context: ReactContext<T>): T {
319 if (__DEV__) {

Callers 4

renderNodeFunction · 0.90
retryRenderTaskFunction · 0.90
retryReplayTaskFunction · 0.90
finishHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected