()
| 180 | } |
| 181 | |
| 182 | function createWorkInProgressHook(): Hook { |
| 183 | if (workInProgressHook === null) { |
| 184 | // This is the first hook in the list |
| 185 | if (firstWorkInProgressHook === null) { |
| 186 | isReRender = false; |
| 187 | firstWorkInProgressHook = workInProgressHook = createHook(); |
| 188 | } else { |
| 189 | // There's already a work-in-progress. Reuse it. |
| 190 | isReRender = true; |
| 191 | workInProgressHook = firstWorkInProgressHook; |
| 192 | } |
| 193 | } else { |
| 194 | if (workInProgressHook.next === null) { |
| 195 | isReRender = false; |
| 196 | // Append to the end of the list |
| 197 | workInProgressHook = workInProgressHook.next = createHook(); |
| 198 | } else { |
| 199 | // There's already a work-in-progress. Reuse it. |
| 200 | isReRender = true; |
| 201 | workInProgressHook = workInProgressHook.next; |
| 202 | } |
| 203 | } |
| 204 | return workInProgressHook; |
| 205 | } |
| 206 | |
| 207 | export function prepareToUseHooks( |
| 208 | request: Request, |
no test coverage detected