()
| 21942 | commitRoot(root); |
| 21943 | } |
| 21944 | function flushDiscreteUpdates() { |
| 21945 | // TODO: Should be able to flush inside batchedUpdates, but not inside `act`. |
| 21946 | // However, `act` uses `batchedUpdates`, so there's no way to distinguish |
| 21947 | // those two cases. Need to fix this before exposing flushDiscreteUpdates |
| 21948 | // as a public API. |
| 21949 | if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) { |
| 21950 | { |
| 21951 | if ((executionContext & RenderContext) !== NoContext) { |
| 21952 | error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.'); |
| 21953 | } |
| 21954 | } // We're already rendering, so we can't synchronously flush pending work. |
| 21955 | // This is probably a nested event dispatch triggered by a lifecycle/effect, |
| 21956 | // like `el.focus()`. Exit. |
| 21957 | |
| 21958 | |
| 21959 | return; |
| 21960 | } |
| 21961 | |
| 21962 | flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that |
| 21963 | // they fire before the next serial event. |
| 21964 | |
| 21965 | flushPassiveEffects(); |
| 21966 | } |
| 21967 | function syncUpdates(fn, a, b, c) { |
| 21968 | return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c)); |
| 21969 | } |
nothing calls this directly
no test coverage detected