MCPcopy Create free account
hub / github.com/plotly/dash / getStateFromUpdate

Function getStateFromUpdate

dash/deps/react-dom@18.3.1.js:14760–14849  ·  view source on GitHub ↗
(workInProgress, queue, update, prevState, nextProps, instance)

Source from the content-addressed store, hash-verified

14758 }
14759
14760 function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
14761 switch (update.tag) {
14762 case ReplaceState:
14763 {
14764 var payload = update.payload;
14765
14766 if (typeof payload === 'function') {
14767 // Updater function
14768 {
14769 enterDisallowedContextReadInDEV();
14770 }
14771
14772 var nextState = payload.call(instance, prevState, nextProps);
14773
14774 {
14775 if ( workInProgress.mode & StrictLegacyMode) {
14776 setIsStrictModeForDevtools(true);
14777
14778 try {
14779 payload.call(instance, prevState, nextProps);
14780 } finally {
14781 setIsStrictModeForDevtools(false);
14782 }
14783 }
14784
14785 exitDisallowedContextReadInDEV();
14786 }
14787
14788 return nextState;
14789 } // State object
14790
14791
14792 return payload;
14793 }
14794
14795 case CaptureUpdate:
14796 {
14797 workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;
14798 }
14799 // Intentional fallthrough
14800
14801 case UpdateState:
14802 {
14803 var _payload = update.payload;
14804 var partialState;
14805
14806 if (typeof _payload === 'function') {
14807 // Updater function
14808 {
14809 enterDisallowedContextReadInDEV();
14810 }
14811
14812 partialState = _payload.call(instance, prevState, nextProps);
14813
14814 {
14815 if ( workInProgress.mode & StrictLegacyMode) {
14816 setIsStrictModeForDevtools(true);
14817

Callers 1

processUpdateQueueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…