| 5236 | const fakeActCallbackNode = {}; |
| 5237 | // $FlowFixMe[missing-local-annot] |
| 5238 | function scheduleCallback(priorityLevel: any, callback) { |
| 5239 | if (__DEV__) { |
| 5240 | // If we're currently inside an `act` scope, bypass Scheduler and push to |
| 5241 | // the `act` queue instead. |
| 5242 | const actQueue = ReactSharedInternals.actQueue; |
| 5243 | if (actQueue !== null) { |
| 5244 | actQueue.push(callback); |
| 5245 | return fakeActCallbackNode; |
| 5246 | } else { |
| 5247 | return Scheduler_scheduleCallback(priorityLevel, callback); |
| 5248 | } |
| 5249 | } else { |
| 5250 | // In production, always call Scheduler. This function will be stripped out. |
| 5251 | return Scheduler_scheduleCallback(priorityLevel, callback); |
| 5252 | } |
| 5253 | } |
| 5254 | |
| 5255 | function shouldForceFlushFallbacksInDEV() { |
| 5256 | // Never force flush in production. This function should get stripped out. |