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

Function prepareToUseHooks

packages/react-server/src/ReactFizzHooks.js:207–234  ·  view source on GitHub ↗
(
  request: Request,
  task: Task,
  keyPath: KeyNode | null,
  componentIdentity: Object,
  prevThenableState: ThenableState | null,
)

Source from the content-addressed store, hash-verified

205}
206
207export function prepareToUseHooks(
208 request: Request,
209 task: Task,
210 keyPath: KeyNode | null,
211 componentIdentity: Object,
212 prevThenableState: ThenableState | null,
213): void {
214 currentlyRenderingComponent = componentIdentity;
215 currentlyRenderingTask = task;
216 currentlyRenderingRequest = request;
217 currentlyRenderingKeyPath = keyPath;
218 if (__DEV__) {
219 isInHookUserCodeInDev = false;
220 }
221
222 // The following should have already been reset
223 // didScheduleRenderPhaseUpdate = false;
224 // firstWorkInProgressHook = null;
225 // numberOfReRenders = 0;
226 // renderPhaseUpdates = null;
227 // workInProgressHook = null;
228
229 localIdCounter = 0;
230 actionStateCounter = 0;
231 actionStateMatchingIndex = -1;
232 thenableIndexCounter = 0;
233 thenableState = prevThenableState;
234}
235
236export function prepareToUseThenableState(
237 prevThenableState: ThenableState | null,

Callers 1

renderWithHooksFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected