7
7
* @noflow
8
8
* @nolint
9
9
* @preventMunge
10
- * @generated SignedSource<<a56cd14b45443ff19095298bed47faaf >>
10
+ * @generated SignedSource<<11116a9322957150fb8ff12ea7d79467 >>
11
11
*/
12
12
13
13
'use strict';
@@ -7227,6 +7227,10 @@ function mountReducer(reducer, initialArg, init) {
7227
7227
7228
7228
function updateReducer(reducer, initialArg, init) {
7229
7229
var hook = updateWorkInProgressHook();
7230
+ return updateReducerImpl(hook, currentHook, reducer);
7231
+ }
7232
+
7233
+ function updateReducerImpl(hook, current, reducer) {
7230
7234
var queue = hook.queue;
7231
7235
7232
7236
if (queue === null) {
@@ -7235,10 +7239,9 @@ function updateReducer(reducer, initialArg, init) {
7235
7239
);
7236
7240
}
7237
7241
7238
- queue.lastRenderedReducer = reducer;
7239
- var current = currentHook; // The last rebase update that is NOT part of the base state.
7242
+ queue.lastRenderedReducer = reducer; // The last rebase update that is NOT part of the base state.
7240
7243
7241
- var baseQueue = current .baseQueue; // The last pending update that hasn't been processed yet.
7244
+ var baseQueue = hook .baseQueue; // The last pending update that hasn't been processed yet.
7242
7245
7243
7246
var pendingQueue = queue.pending;
7244
7247
@@ -7271,7 +7274,7 @@ function updateReducer(reducer, initialArg, init) {
7271
7274
if (baseQueue !== null) {
7272
7275
// We have a queue to process.
7273
7276
var first = baseQueue.next;
7274
- var newState = current .baseState;
7277
+ var newState = hook .baseState;
7275
7278
var newBaseState = null;
7276
7279
var newBaseQueueFirst = null;
7277
7280
var newBaseQueueLast = null;
@@ -7296,6 +7299,7 @@ function updateReducer(reducer, initialArg, init) {
7296
7299
// update/state.
7297
7300
var clone = {
7298
7301
lane: updateLane,
7302
+ revertLane: update.revertLane,
7299
7303
action: update.action,
7300
7304
hasEagerState: update.hasEagerState,
7301
7305
eagerState: update.eagerState,
@@ -7317,19 +7321,24 @@ function updateReducer(reducer, initialArg, init) {
7317
7321
);
7318
7322
markSkippedUpdateLanes(updateLane);
7319
7323
} else {
7320
- // This update does have sufficient priority.
7321
- if (newBaseQueueLast !== null) {
7322
- var _clone = {
7323
- // This update is going to be committed so we never want uncommit
7324
- // it. Using NoLane works because 0 is a subset of all bitmasks, so
7325
- // this will never be skipped by the check above.
7326
- lane: NoLane,
7327
- action: update.action,
7328
- hasEagerState: update.hasEagerState,
7329
- eagerState: update.eagerState,
7330
- next: null
7331
- };
7332
- newBaseQueueLast = newBaseQueueLast.next = _clone;
7324
+ {
7325
+ // This is not an optimistic update, and we're going to apply it now.
7326
+ // But, if there were earlier updates that were skipped, we need to
7327
+ // leave this update in the queue so it can be rebased later.
7328
+ if (newBaseQueueLast !== null) {
7329
+ var _clone = {
7330
+ // This update is going to be committed so we never want uncommit
7331
+ // it. Using NoLane works because 0 is a subset of all bitmasks, so
7332
+ // this will never be skipped by the check above.
7333
+ lane: NoLane,
7334
+ revertLane: NoLane,
7335
+ action: update.action,
7336
+ hasEagerState: update.hasEagerState,
7337
+ eagerState: update.eagerState,
7338
+ next: null
7339
+ };
7340
+ newBaseQueueLast = newBaseQueueLast.next = _clone;
7341
+ }
7333
7342
} // Process this update.
7334
7343
7335
7344
var action = update.action;
@@ -7650,7 +7659,7 @@ function forceStoreRerender(fiber) {
7650
7659
}
7651
7660
}
7652
7661
7653
- function mountState (initialState) {
7662
+ function mountStateImpl (initialState) {
7654
7663
var hook = mountWorkInProgressHook();
7655
7664
7656
7665
if (typeof initialState === "function") {
@@ -7667,11 +7676,14 @@ function mountState(initialState) {
7667
7676
lastRenderedState: initialState
7668
7677
};
7669
7678
hook.queue = queue;
7670
- var dispatch = (queue.dispatch = dispatchSetState.bind(
7671
- null,
7672
- currentlyRenderingFiber$1,
7673
- queue
7674
- ));
7679
+ return hook;
7680
+ }
7681
+
7682
+ function mountState(initialState) {
7683
+ var hook = mountStateImpl(initialState);
7684
+ var queue = hook.queue;
7685
+ var dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
7686
+ queue.dispatch = dispatch;
7675
7687
return [hook.memoizedState, dispatch];
7676
7688
}
7677
7689
@@ -8030,9 +8042,10 @@ function updateDeferredValueImpl(hook, prevValue, value) {
8030
8042
}
8031
8043
8032
8044
function startTransition(
8045
+ fiber,
8046
+ queue,
8033
8047
pendingState,
8034
8048
finishedState,
8035
- setPending,
8036
8049
callback,
8037
8050
options
8038
8051
) {
@@ -8041,8 +8054,12 @@ function startTransition(
8041
8054
higherEventPriority(previousPriority, ContinuousEventPriority)
8042
8055
);
8043
8056
var prevTransition = ReactCurrentBatchConfig$2.transition;
8044
- ReactCurrentBatchConfig$2.transition = null;
8045
- setPending(pendingState);
8057
+
8058
+ {
8059
+ ReactCurrentBatchConfig$2.transition = null;
8060
+ dispatchSetState(fiber, queue, pendingState);
8061
+ }
8062
+
8046
8063
var currentTransition = (ReactCurrentBatchConfig$2.transition = {});
8047
8064
8048
8065
{
@@ -8054,7 +8071,7 @@ function startTransition(
8054
8071
if (enableAsyncActions);
8055
8072
else {
8056
8073
// Async actions are not enabled.
8057
- setPending( finishedState);
8074
+ dispatchSetState(fiber, queue, finishedState);
8058
8075
callback();
8059
8076
}
8060
8077
} catch (error) {
@@ -8086,10 +8103,15 @@ function startTransition(
8086
8103
}
8087
8104
8088
8105
function mountTransition() {
8089
- var _mountState = mountState(false),
8090
- setPending = _mountState[1]; // The `start` method never changes.
8106
+ var stateHook = mountStateImpl(false); // The `start` method never changes.
8091
8107
8092
- var start = startTransition.bind(null, true, false, setPending);
8108
+ var start = startTransition.bind(
8109
+ null,
8110
+ currentlyRenderingFiber$1,
8111
+ stateHook.queue,
8112
+ true,
8113
+ false
8114
+ );
8093
8115
var hook = mountWorkInProgressHook();
8094
8116
hook.memoizedState = start;
8095
8117
return [false, start];
@@ -8222,6 +8244,7 @@ function dispatchReducerAction(fiber, queue, action) {
8222
8244
var lane = requestUpdateLane(fiber);
8223
8245
var update = {
8224
8246
lane: lane,
8247
+ revertLane: NoLane,
8225
8248
action: action,
8226
8249
hasEagerState: false,
8227
8250
eagerState: null,
@@ -8254,6 +8277,7 @@ function dispatchSetState(fiber, queue, action) {
8254
8277
var lane = requestUpdateLane(fiber);
8255
8278
var update = {
8256
8279
lane: lane,
8280
+ revertLane: NoLane,
8257
8281
action: action,
8258
8282
hasEagerState: false,
8259
8283
eagerState: null,
@@ -23894,7 +23918,7 @@ function createFiberRoot(
23894
23918
return root;
23895
23919
}
23896
23920
23897
- var ReactVersion = "18.3.0-next-9545e4810 -20230501";
23921
+ var ReactVersion = "18.3.0-next-491aec5d6 -20230501";
23898
23922
23899
23923
// Might add PROFILE later.
23900
23924
0 commit comments