( request: Request, task: Task, keyPath: KeyNode, Component: (p: Props, arg: SecondArg) => any, props: Props, secondArg: SecondArg, )
| 2330 | } |
| 2331 | |
| 2332 | function renderWithHooks<Props, SecondArg>( |
| 2333 | request: Request, |
| 2334 | task: Task, |
| 2335 | keyPath: KeyNode, |
| 2336 | Component: (p: Props, arg: SecondArg) => any, |
| 2337 | props: Props, |
| 2338 | secondArg: SecondArg, |
| 2339 | ): any { |
| 2340 | // Reset the task's thenable state before continuing, so that if a later |
| 2341 | // component suspends we can reuse the same task object. If the same |
| 2342 | // component suspends again, the thenable state will be restored. |
| 2343 | const prevThenableState = task.thenableState; |
| 2344 | task.thenableState = null; |
| 2345 | const componentIdentity = {}; |
| 2346 | prepareToUseHooks( |
| 2347 | request, |
| 2348 | task, |
| 2349 | keyPath, |
| 2350 | componentIdentity, |
| 2351 | prevThenableState, |
| 2352 | ); |
| 2353 | let result; |
| 2354 | if (__DEV__) { |
| 2355 | result = callComponentInDEV(Component, props, secondArg); |
| 2356 | } else { |
| 2357 | result = Component(props, secondArg); |
| 2358 | } |
| 2359 | return finishHooks(Component, props, result, secondArg); |
| 2360 | } |
| 2361 | |
| 2362 | function finishClassComponent( |
| 2363 | request: Request, |
no test coverage detected