| 205 | } |
| 206 | |
| 207 | export 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 | |
| 236 | export function prepareToUseThenableState( |
| 237 | prevThenableState: ThenableState | null, |