(current: Fiber | null, workInProgress: Fiber)
| 1380 | } |
| 1381 | |
| 1382 | function markRef(current: Fiber | null, workInProgress: Fiber) { |
| 1383 | // TODO: Check props.ref instead of fiber.ref when enableRefAsProp is on. |
| 1384 | const ref = workInProgress.ref; |
| 1385 | if (ref === null) { |
| 1386 | if (current !== null && current.ref !== null) { |
| 1387 | // Schedule a Ref effect |
| 1388 | workInProgress.flags |= Ref | RefStatic; |
| 1389 | } |
| 1390 | } else { |
| 1391 | if (typeof ref !== 'function' && typeof ref !== 'object') { |
| 1392 | throw new Error( |
| 1393 | 'Expected ref to be a function, an object returned by React.createRef(), or undefined/null.', |
| 1394 | ); |
| 1395 | } |
| 1396 | if (current === null || current.ref !== ref) { |
| 1397 | // Schedule a Ref effect |
| 1398 | workInProgress.flags |= Ref | RefStatic; |
| 1399 | } |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | function mountIncompleteFunctionComponent( |
| 1404 | _current: null | Fiber, |
no outgoing calls
no test coverage detected