MCPcopy Create free account
hub / github.com/microsoft/SandDance / finishEventHandler

Function finishEventHandler

docs/external/js/react-dom.development.js:750–764  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

748 var isBatchingEventUpdates = false;
749
750 function finishEventHandler() {
751 // Here we wait until all updates have propagated, which is important
752 // when using controlled components within layers:
753 // https://github.com/facebook/react/issues/1698
754 // Then we restore state of any controlled component.
755 var controlledComponentsHavePendingUpdates = needsStateRestore();
756
757 if (controlledComponentsHavePendingUpdates) {
758 // If a controlled event was fired, we may need to restore the state of
759 // the DOM node back to the controlled value. This is necessary when React
760 // bails out of the update without touching the DOM.
761 flushDiscreteUpdatesImpl();
762 restoreStateIfNeeded();
763 }
764 }
765
766 function batchedUpdates(fn, bookkeeping) {
767 if (isInsideEventHandler) {

Callers 3

batchedUpdatesFunction · 0.85
batchedEventUpdatesFunction · 0.85
discreteUpdatesFunction · 0.85

Calls 3

needsStateRestoreFunction · 0.85
flushDiscreteUpdatesImplFunction · 0.85
restoreStateIfNeededFunction · 0.85

Tested by

no test coverage detected