( priorityLevel: PriorityLevel, callback: RenderTaskFn, )
| 624 | const fakeActCallbackNode = {}; |
| 625 | |
| 626 | function scheduleCallback( |
| 627 | priorityLevel: PriorityLevel, |
| 628 | callback: RenderTaskFn, |
| 629 | ) { |
| 630 | if (__DEV__ && ReactSharedInternals.actQueue !== null) { |
| 631 | // Special case: We're inside an `act` scope (a testing utility). |
| 632 | // Instead of scheduling work in the host environment, add it to a |
| 633 | // fake internal queue that's managed by the `act` implementation. |
| 634 | ReactSharedInternals.actQueue.push(callback); |
| 635 | return fakeActCallbackNode; |
| 636 | } else { |
| 637 | return Scheduler_scheduleCallback(priorityLevel, callback); |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | function cancelCallback(callbackNode: mixed) { |
| 642 | if (__DEV__ && callbackNode === fakeActCallbackNode) { |
no test coverage detected