@@ -839,6 +839,17 @@ export default function(
839
839
newState === null || newState === undefined
840
840
? derivedStateFromProps
841
841
: Object . assign ( { } , newState , derivedStateFromProps ) ;
842
+
843
+ // Update the base state of the update queue.
844
+ // FIXME: This is getting ridiculous. Refactor plz!
845
+ const updateQueue = workInProgress . updateQueue ;
846
+ if ( updateQueue !== null ) {
847
+ updateQueue . baseState = Object . assign (
848
+ { } ,
849
+ updateQueue . baseState ,
850
+ derivedStateFromProps ,
851
+ ) ;
852
+ }
842
853
}
843
854
if ( derivedStateFromCatch !== null && derivedStateFromCatch !== undefined ) {
844
855
// Render-phase updates (like this) should not be added to the update queue,
@@ -848,6 +859,17 @@ export default function(
848
859
newState === null || newState === undefined
849
860
? derivedStateFromCatch
850
861
: Object . assign ( { } , newState , derivedStateFromCatch ) ;
862
+
863
+ // Update the base state of the update queue.
864
+ // FIXME: This is getting ridiculous. Refactor plz!
865
+ const updateQueue = workInProgress . updateQueue ;
866
+ if ( updateQueue !== null ) {
867
+ updateQueue . baseState = Object . assign (
868
+ { } ,
869
+ updateQueue . baseState ,
870
+ derivedStateFromCatch ,
871
+ ) ;
872
+ }
851
873
}
852
874
853
875
if (
@@ -1016,6 +1038,17 @@ export default function(
1016
1038
newState === null || newState === undefined
1017
1039
? derivedStateFromProps
1018
1040
: Object . assign ( { } , newState , derivedStateFromProps ) ;
1041
+
1042
+ // Update the base state of the update queue.
1043
+ // FIXME: This is getting ridiculous. Refactor plz!
1044
+ const updateQueue = workInProgress . updateQueue ;
1045
+ if ( updateQueue !== null ) {
1046
+ updateQueue . baseState = Object . assign (
1047
+ { } ,
1048
+ updateQueue . baseState ,
1049
+ derivedStateFromProps ,
1050
+ ) ;
1051
+ }
1019
1052
}
1020
1053
if ( derivedStateFromCatch !== null && derivedStateFromCatch !== undefined ) {
1021
1054
// Render-phase updates (like this) should not be added to the update queue,
@@ -1025,6 +1058,17 @@ export default function(
1025
1058
newState === null || newState === undefined
1026
1059
? derivedStateFromCatch
1027
1060
: Object . assign ( { } , newState , derivedStateFromCatch ) ;
1061
+
1062
+ // Update the base state of the update queue.
1063
+ // FIXME: This is getting ridiculous. Refactor plz!
1064
+ const updateQueue = workInProgress . updateQueue ;
1065
+ if ( updateQueue !== null ) {
1066
+ updateQueue . baseState = Object . assign (
1067
+ { } ,
1068
+ updateQueue . baseState ,
1069
+ derivedStateFromCatch ,
1070
+ ) ;
1071
+ }
1028
1072
}
1029
1073
1030
1074
if (
0 commit comments