MCPcopy Index your code
hub / github.com/plotly/dash / getStateFromUpdate

Function getStateFromUpdate

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

Source from the content-addressed store, hash-verified

13645 }
13646
13647 function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
13648 switch (update.tag) {
13649 case ReplaceState:
13650 {
13651 var payload = update.payload;
13652
13653 if (typeof payload === 'function') {
13654 // Updater function
13655 {
13656 enterDisallowedContextReadInDEV();
13657 }
13658
13659 var nextState = payload.call(instance, prevState, nextProps);
13660
13661 {
13662 if ( workInProgress.mode & StrictLegacyMode) {
13663 setIsStrictModeForDevtools(true);
13664
13665 try {
13666 payload.call(instance, prevState, nextProps);
13667 } finally {
13668 setIsStrictModeForDevtools(false);
13669 }
13670 }
13671
13672 exitDisallowedContextReadInDEV();
13673 }
13674
13675 return nextState;
13676 } // State object
13677
13678
13679 return payload;
13680 }
13681
13682 case CaptureUpdate:
13683 {
13684 workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;
13685 }
13686 // Intentional fallthrough
13687
13688 case UpdateState:
13689 {
13690 var _payload = update.payload;
13691 var partialState;
13692
13693 if (typeof _payload === 'function') {
13694 // Updater function
13695 {
13696 enterDisallowedContextReadInDEV();
13697 }
13698
13699 partialState = _payload.call(instance, prevState, nextProps);
13700
13701 {
13702 if ( workInProgress.mode & StrictLegacyMode) {
13703 setIsStrictModeForDevtools(true);
13704

Callers 1

processUpdateQueueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…