Files
react/packages/react-noop-renderer
Andrew Clark 32eefcb3c5 Replace flushDiscreteUpdates with flushSync (#21775)
* Replace flushDiscreteUpdates with flushSync

flushDiscreteUpdates is almost the same as flushSync. It forces passive
effects to fire, because of an outdated heuristic, which isn't ideal but
not that important.

Besides that, the only remaining difference between flushDiscreteUpdates
and flushSync is that flushDiscreteUpdates does not warn if you call it
from inside an effect/lifecycle. This is because it might get triggered
by a nested event dispatch, like `el.focus()`.

So I added a new method, flushSyncWithWarningIfAlreadyRendering, which
is used for the public flushSync API. It includes the warning. And I
removed the warning from flushSync, so the event system can call that
one. In production, flushSyncWithWarningIfAlreadyRendering gets inlined
to flushSync, so the behavior is identical.

Another way of thinking about this PR is that I renamed flushSync to
flushSyncWithWarningIfAlreadyRendering and flushDiscreteUpdates to
flushSync (and fixed the passive effects thing). The point is to prevent
these from subtly diverging in the future.

* Invert so the one with the warning is the default one

To make Seb happy
2021-07-01 15:13:00 -07:00
..
2020-10-30 23:03:45 -07:00
2020-10-30 23:03:45 -07:00
2016-10-25 08:36:37 +01:00

react-noop-renderer

This package is the renderer we use for debugging Fiber. It is not intended to be used directly.