react-dom 17.0.0-rc.1 → 17.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +5 -5
- package/cjs/react-dom-server.browser.development.js +5 -5
- package/cjs/react-dom-server.browser.production.min.js +2 -2
- package/cjs/react-dom-server.node.development.js +5 -5
- package/cjs/react-dom-server.node.production.min.js +2 -2
- package/cjs/react-dom-test-utils.development.js +271 -138
- package/cjs/react-dom-test-utils.production.min.js +36 -33
- package/cjs/react-dom.development.js +747 -579
- package/cjs/react-dom.production.min.js +230 -231
- package/cjs/react-dom.profiling.min.js +258 -257
- package/package.json +3 -3
- package/umd/react-dom-server.browser.development.js +5 -5
- package/umd/react-dom-server.browser.production.min.js +3 -3
- package/umd/react-dom-test-utils.development.js +271 -138
- package/umd/react-dom-test-utils.production.min.js +27 -25
- package/umd/react-dom.development.js +747 -579
- package/umd/react-dom.production.min.js +232 -232
- package/umd/react-dom.profiling.min.js +241 -243
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React
|
|
1
|
+
/** @license React v17.0.1
|
|
2
2
|
* react-dom.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
* Mapping from registration name to event name
|
|
111
111
|
*/
|
|
112
112
|
|
|
113
|
+
|
|
113
114
|
var registrationNameDependencies = {};
|
|
114
115
|
/**
|
|
115
116
|
* Mapping from lowercase registration names to the properly cased version,
|
|
@@ -142,10 +143,8 @@
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
{
|
|
146
|
-
|
|
147
|
-
allNativeEvents.add(dependencies[i]);
|
|
148
|
-
}
|
|
146
|
+
for (var i = 0; i < dependencies.length; i++) {
|
|
147
|
+
allNativeEvents.add(dependencies[i]);
|
|
149
148
|
}
|
|
150
149
|
}
|
|
151
150
|
|
|
@@ -1180,7 +1179,7 @@
|
|
|
1180
1179
|
return 'Portal';
|
|
1181
1180
|
|
|
1182
1181
|
case REACT_PROFILER_TYPE:
|
|
1183
|
-
return
|
|
1182
|
+
return 'Profiler';
|
|
1184
1183
|
|
|
1185
1184
|
case REACT_STRICT_MODE_TYPE:
|
|
1186
1185
|
return 'StrictMode';
|
|
@@ -4148,8 +4147,8 @@
|
|
|
4148
4147
|
}
|
|
4149
4148
|
|
|
4150
4149
|
// Don't change these two values. They're used by React Dev Tools.
|
|
4151
|
-
var
|
|
4152
|
-
/*
|
|
4150
|
+
var NoFlags =
|
|
4151
|
+
/* */
|
|
4153
4152
|
0;
|
|
4154
4153
|
var PerformedWork =
|
|
4155
4154
|
/* */
|
|
@@ -4227,7 +4226,7 @@
|
|
|
4227
4226
|
do {
|
|
4228
4227
|
node = nextNode;
|
|
4229
4228
|
|
|
4230
|
-
if ((node.
|
|
4229
|
+
if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
4231
4230
|
// This is an insertion or in-progress hydration. The nearest possible
|
|
4232
4231
|
// mounted fiber is the parent but we need to continue to figure out
|
|
4233
4232
|
// if that one is still mounted.
|
|
@@ -5519,7 +5518,21 @@
|
|
|
5519
5518
|
|
|
5520
5519
|
if (priority >= InputContinuousLanePriority) {
|
|
5521
5520
|
// User interactions should expire slightly more quickly.
|
|
5522
|
-
|
|
5521
|
+
//
|
|
5522
|
+
// NOTE: This is set to the corresponding constant as in Scheduler.js. When
|
|
5523
|
+
// we made it larger, a product metric in www regressed, suggesting there's
|
|
5524
|
+
// a user interaction that's being starved by a series of synchronous
|
|
5525
|
+
// updates. If that theory is correct, the proper solution is to fix the
|
|
5526
|
+
// starvation. However, this scenario supports the idea that expiration
|
|
5527
|
+
// times are an important safeguard when starvation does happen.
|
|
5528
|
+
//
|
|
5529
|
+
// Also note that, in the case of user input specifically, this will soon no
|
|
5530
|
+
// longer be an issue because we plan to make user input synchronous by
|
|
5531
|
+
// default (until you enter `startTransition`, of course.)
|
|
5532
|
+
//
|
|
5533
|
+
// If weren't planning to make these updates synchronous soon anyway, I
|
|
5534
|
+
// would probably make this number a configurable parameter.
|
|
5535
|
+
return currentTime + 250;
|
|
5523
5536
|
} else if (priority >= TransitionPriority) {
|
|
5524
5537
|
return currentTime + 5000;
|
|
5525
5538
|
} else {
|
|
@@ -5754,7 +5767,15 @@
|
|
|
5754
5767
|
return a !== NoLane && a < b ? a : b;
|
|
5755
5768
|
}
|
|
5756
5769
|
function createLaneMap(initial) {
|
|
5757
|
-
|
|
5770
|
+
// Intentionally pushing one by one.
|
|
5771
|
+
// https://v8.dev/blog/elements-kinds#avoid-creating-holes
|
|
5772
|
+
var laneMap = [];
|
|
5773
|
+
|
|
5774
|
+
for (var i = 0; i < TotalLanes; i++) {
|
|
5775
|
+
laneMap.push(initial);
|
|
5776
|
+
}
|
|
5777
|
+
|
|
5778
|
+
return laneMap;
|
|
5758
5779
|
}
|
|
5759
5780
|
function markRootUpdated(root, updateLane, eventTime) {
|
|
5760
5781
|
root.pendingLanes |= updateLane; // TODO: Theoretically, any update to any lane can unblock any other lane. But
|
|
@@ -5868,8 +5889,8 @@
|
|
|
5868
5889
|
function isEnabled() {
|
|
5869
5890
|
return _enabled;
|
|
5870
5891
|
}
|
|
5871
|
-
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags
|
|
5872
|
-
var eventPriority =
|
|
5892
|
+
function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
|
|
5893
|
+
var eventPriority = getEventPriorityForPluginSystem(domEventName);
|
|
5873
5894
|
var listenerWrapper;
|
|
5874
5895
|
|
|
5875
5896
|
switch (eventPriority) {
|
|
@@ -6037,9 +6058,6 @@
|
|
|
6037
6058
|
});
|
|
6038
6059
|
return listener;
|
|
6039
6060
|
}
|
|
6040
|
-
function removeEventListener(target, eventType, listener, capture) {
|
|
6041
|
-
target.removeEventListener(eventType, listener, capture);
|
|
6042
|
-
}
|
|
6043
6061
|
|
|
6044
6062
|
/**
|
|
6045
6063
|
* These variables store information about text content of a target node,
|
|
@@ -6143,136 +6161,144 @@
|
|
|
6143
6161
|
return 0;
|
|
6144
6162
|
}
|
|
6145
6163
|
|
|
6146
|
-
/**
|
|
6147
|
-
* @interface Event
|
|
6148
|
-
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
6149
|
-
*/
|
|
6150
|
-
var EventInterface = {
|
|
6151
|
-
eventPhase: 0,
|
|
6152
|
-
bubbles: 0,
|
|
6153
|
-
cancelable: 0,
|
|
6154
|
-
timeStamp: function (event) {
|
|
6155
|
-
return event.timeStamp || Date.now();
|
|
6156
|
-
},
|
|
6157
|
-
defaultPrevented: 0,
|
|
6158
|
-
isTrusted: 0
|
|
6159
|
-
};
|
|
6160
|
-
|
|
6161
6164
|
function functionThatReturnsTrue() {
|
|
6162
6165
|
return true;
|
|
6163
6166
|
}
|
|
6164
6167
|
|
|
6165
6168
|
function functionThatReturnsFalse() {
|
|
6166
6169
|
return false;
|
|
6167
|
-
}
|
|
6168
|
-
|
|
6169
|
-
* Synthetic events are dispatched by event plugins, typically in response to a
|
|
6170
|
-
* top-level event delegation handler.
|
|
6171
|
-
*
|
|
6172
|
-
* These systems should generally use pooling to reduce the frequency of garbage
|
|
6173
|
-
* collection. The system should check `isPersistent` to determine whether the
|
|
6174
|
-
* event should be released into the pool after being dispatched. Users that
|
|
6175
|
-
* need a persisted event should invoke `persist`.
|
|
6176
|
-
*
|
|
6177
|
-
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
|
|
6178
|
-
* normalizing browser quirks. Subclasses do not necessarily have to implement a
|
|
6179
|
-
* DOM interface; custom application-specific events can also subclass this.
|
|
6180
|
-
*/
|
|
6170
|
+
} // This is intentionally a factory so that we have different returned constructors.
|
|
6171
|
+
// If we had a single constructor, it would be megamorphic and engines would deopt.
|
|
6181
6172
|
|
|
6182
6173
|
|
|
6183
|
-
function
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6174
|
+
function createSyntheticEvent(Interface) {
|
|
6175
|
+
/**
|
|
6176
|
+
* Synthetic events are dispatched by event plugins, typically in response to a
|
|
6177
|
+
* top-level event delegation handler.
|
|
6178
|
+
*
|
|
6179
|
+
* These systems should generally use pooling to reduce the frequency of garbage
|
|
6180
|
+
* collection. The system should check `isPersistent` to determine whether the
|
|
6181
|
+
* event should be released into the pool after being dispatched. Users that
|
|
6182
|
+
* need a persisted event should invoke `persist`.
|
|
6183
|
+
*
|
|
6184
|
+
* Synthetic events (and subclasses) implement the DOM Level 3 Events API by
|
|
6185
|
+
* normalizing browser quirks. Subclasses do not necessarily have to implement a
|
|
6186
|
+
* DOM interface; custom application-specific events can also subclass this.
|
|
6187
|
+
*/
|
|
6188
|
+
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
|
|
6189
|
+
this._reactName = reactName;
|
|
6190
|
+
this._targetInst = targetInst;
|
|
6191
|
+
this.type = reactEventType;
|
|
6192
|
+
this.nativeEvent = nativeEvent;
|
|
6193
|
+
this.target = nativeEventTarget;
|
|
6194
|
+
this.currentTarget = null;
|
|
6195
|
+
|
|
6196
|
+
for (var _propName in Interface) {
|
|
6197
|
+
if (!Interface.hasOwnProperty(_propName)) {
|
|
6198
|
+
continue;
|
|
6199
|
+
}
|
|
6191
6200
|
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6201
|
+
var normalize = Interface[_propName];
|
|
6202
|
+
|
|
6203
|
+
if (normalize) {
|
|
6204
|
+
this[_propName] = normalize(nativeEvent);
|
|
6205
|
+
} else {
|
|
6206
|
+
this[_propName] = nativeEvent[_propName];
|
|
6207
|
+
}
|
|
6195
6208
|
}
|
|
6196
6209
|
|
|
6197
|
-
var
|
|
6210
|
+
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
6198
6211
|
|
|
6199
|
-
if (
|
|
6200
|
-
this
|
|
6212
|
+
if (defaultPrevented) {
|
|
6213
|
+
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
6201
6214
|
} else {
|
|
6202
|
-
this
|
|
6215
|
+
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
6203
6216
|
}
|
|
6217
|
+
|
|
6218
|
+
this.isPropagationStopped = functionThatReturnsFalse;
|
|
6219
|
+
return this;
|
|
6204
6220
|
}
|
|
6205
6221
|
|
|
6206
|
-
|
|
6222
|
+
_assign(SyntheticBaseEvent.prototype, {
|
|
6223
|
+
preventDefault: function () {
|
|
6224
|
+
this.defaultPrevented = true;
|
|
6225
|
+
var event = this.nativeEvent;
|
|
6207
6226
|
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
this.isDefaultPrevented = functionThatReturnsFalse;
|
|
6212
|
-
}
|
|
6227
|
+
if (!event) {
|
|
6228
|
+
return;
|
|
6229
|
+
}
|
|
6213
6230
|
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6231
|
+
if (event.preventDefault) {
|
|
6232
|
+
event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE
|
|
6233
|
+
} else if (typeof event.returnValue !== 'unknown') {
|
|
6234
|
+
event.returnValue = false;
|
|
6235
|
+
}
|
|
6217
6236
|
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6237
|
+
this.isDefaultPrevented = functionThatReturnsTrue;
|
|
6238
|
+
},
|
|
6239
|
+
stopPropagation: function () {
|
|
6240
|
+
var event = this.nativeEvent;
|
|
6222
6241
|
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6242
|
+
if (!event) {
|
|
6243
|
+
return;
|
|
6244
|
+
}
|
|
6226
6245
|
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6246
|
+
if (event.stopPropagation) {
|
|
6247
|
+
event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE
|
|
6248
|
+
} else if (typeof event.cancelBubble !== 'unknown') {
|
|
6249
|
+
// The ChangeEventPlugin registers a "propertychange" event for
|
|
6250
|
+
// IE. This event does not support bubbling or cancelling, and
|
|
6251
|
+
// any references to cancelBubble throw "Member not found". A
|
|
6252
|
+
// typeof check of "unknown" circumvents this issue (and is also
|
|
6253
|
+
// IE specific).
|
|
6254
|
+
event.cancelBubble = true;
|
|
6255
|
+
}
|
|
6232
6256
|
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
stopPropagation: function () {
|
|
6236
|
-
var event = this.nativeEvent;
|
|
6257
|
+
this.isPropagationStopped = functionThatReturnsTrue;
|
|
6258
|
+
},
|
|
6237
6259
|
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6260
|
+
/**
|
|
6261
|
+
* We release all dispatched `SyntheticEvent`s after each event loop, adding
|
|
6262
|
+
* them back into the pool. This allows a way to hold onto a reference that
|
|
6263
|
+
* won't be added back into the pool.
|
|
6264
|
+
*/
|
|
6265
|
+
persist: function () {// Modern event system doesn't use pooling.
|
|
6266
|
+
},
|
|
6241
6267
|
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
// IE specific).
|
|
6250
|
-
event.cancelBubble = true;
|
|
6251
|
-
}
|
|
6268
|
+
/**
|
|
6269
|
+
* Checks if this event should be released back into the pool.
|
|
6270
|
+
*
|
|
6271
|
+
* @return {boolean} True if this should not be released, false otherwise.
|
|
6272
|
+
*/
|
|
6273
|
+
isPersistent: functionThatReturnsTrue
|
|
6274
|
+
});
|
|
6252
6275
|
|
|
6253
|
-
|
|
6254
|
-
|
|
6276
|
+
return SyntheticBaseEvent;
|
|
6277
|
+
}
|
|
6278
|
+
/**
|
|
6279
|
+
* @interface Event
|
|
6280
|
+
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
6281
|
+
*/
|
|
6255
6282
|
|
|
6256
|
-
/**
|
|
6257
|
-
* We release all dispatched `SyntheticEvent`s after each event loop, adding
|
|
6258
|
-
* them back into the pool. This allows a way to hold onto a reference that
|
|
6259
|
-
* won't be added back into the pool.
|
|
6260
|
-
*/
|
|
6261
|
-
persist: function () {// Modern event system doesn't use pooling.
|
|
6262
|
-
},
|
|
6263
6283
|
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6284
|
+
var EventInterface = {
|
|
6285
|
+
eventPhase: 0,
|
|
6286
|
+
bubbles: 0,
|
|
6287
|
+
cancelable: 0,
|
|
6288
|
+
timeStamp: function (event) {
|
|
6289
|
+
return event.timeStamp || Date.now();
|
|
6290
|
+
},
|
|
6291
|
+
defaultPrevented: 0,
|
|
6292
|
+
isTrusted: 0
|
|
6293
|
+
};
|
|
6294
|
+
var SyntheticEvent = createSyntheticEvent(EventInterface);
|
|
6271
6295
|
|
|
6272
6296
|
var UIEventInterface = _assign({}, EventInterface, {
|
|
6273
6297
|
view: 0,
|
|
6274
6298
|
detail: 0
|
|
6275
6299
|
});
|
|
6300
|
+
|
|
6301
|
+
var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
|
|
6276
6302
|
var lastMovementX;
|
|
6277
6303
|
var lastMovementY;
|
|
6278
6304
|
var lastMouseEvent;
|
|
@@ -6333,6 +6359,8 @@
|
|
|
6333
6359
|
return lastMovementY;
|
|
6334
6360
|
}
|
|
6335
6361
|
});
|
|
6362
|
+
|
|
6363
|
+
var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
|
|
6336
6364
|
/**
|
|
6337
6365
|
* @interface DragEvent
|
|
6338
6366
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
@@ -6341,6 +6369,8 @@
|
|
|
6341
6369
|
var DragEventInterface = _assign({}, MouseEventInterface, {
|
|
6342
6370
|
dataTransfer: 0
|
|
6343
6371
|
});
|
|
6372
|
+
|
|
6373
|
+
var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
|
|
6344
6374
|
/**
|
|
6345
6375
|
* @interface FocusEvent
|
|
6346
6376
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
@@ -6349,6 +6379,8 @@
|
|
|
6349
6379
|
var FocusEventInterface = _assign({}, UIEventInterface, {
|
|
6350
6380
|
relatedTarget: 0
|
|
6351
6381
|
});
|
|
6382
|
+
|
|
6383
|
+
var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
|
|
6352
6384
|
/**
|
|
6353
6385
|
* @interface Event
|
|
6354
6386
|
* @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
|
|
@@ -6360,6 +6392,8 @@
|
|
|
6360
6392
|
elapsedTime: 0,
|
|
6361
6393
|
pseudoElement: 0
|
|
6362
6394
|
});
|
|
6395
|
+
|
|
6396
|
+
var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
|
|
6363
6397
|
/**
|
|
6364
6398
|
* @interface Event
|
|
6365
6399
|
* @see http://www.w3.org/TR/clipboard-apis/
|
|
@@ -6370,6 +6404,8 @@
|
|
|
6370
6404
|
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
|
6371
6405
|
}
|
|
6372
6406
|
});
|
|
6407
|
+
|
|
6408
|
+
var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
|
|
6373
6409
|
/**
|
|
6374
6410
|
* @interface Event
|
|
6375
6411
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
|
|
@@ -6378,6 +6414,8 @@
|
|
|
6378
6414
|
var CompositionEventInterface = _assign({}, EventInterface, {
|
|
6379
6415
|
data: 0
|
|
6380
6416
|
});
|
|
6417
|
+
|
|
6418
|
+
var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
|
|
6381
6419
|
/**
|
|
6382
6420
|
* @interface Event
|
|
6383
6421
|
* @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
|
|
@@ -6385,7 +6423,7 @@
|
|
|
6385
6423
|
*/
|
|
6386
6424
|
// Happens to share the same list for now.
|
|
6387
6425
|
|
|
6388
|
-
var
|
|
6426
|
+
var SyntheticInputEvent = SyntheticCompositionEvent;
|
|
6389
6427
|
/**
|
|
6390
6428
|
* Normalization of deprecated HTML5 `key` values
|
|
6391
6429
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
|
|
@@ -6569,6 +6607,8 @@
|
|
|
6569
6607
|
return 0;
|
|
6570
6608
|
}
|
|
6571
6609
|
});
|
|
6610
|
+
|
|
6611
|
+
var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
|
|
6572
6612
|
/**
|
|
6573
6613
|
* @interface PointerEvent
|
|
6574
6614
|
* @see http://www.w3.org/TR/pointerevents/
|
|
@@ -6586,6 +6626,8 @@
|
|
|
6586
6626
|
pointerType: 0,
|
|
6587
6627
|
isPrimary: 0
|
|
6588
6628
|
});
|
|
6629
|
+
|
|
6630
|
+
var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
|
|
6589
6631
|
/**
|
|
6590
6632
|
* @interface TouchEvent
|
|
6591
6633
|
* @see http://www.w3.org/TR/touch-events/
|
|
@@ -6601,6 +6643,8 @@
|
|
|
6601
6643
|
shiftKey: 0,
|
|
6602
6644
|
getModifierState: getEventModifierState
|
|
6603
6645
|
});
|
|
6646
|
+
|
|
6647
|
+
var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
|
|
6604
6648
|
/**
|
|
6605
6649
|
* @interface Event
|
|
6606
6650
|
* @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
|
|
@@ -6612,6 +6656,8 @@
|
|
|
6612
6656
|
elapsedTime: 0,
|
|
6613
6657
|
pseudoElement: 0
|
|
6614
6658
|
});
|
|
6659
|
+
|
|
6660
|
+
var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
|
|
6615
6661
|
/**
|
|
6616
6662
|
* @interface WheelEvent
|
|
6617
6663
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
@@ -6635,6 +6681,8 @@
|
|
|
6635
6681
|
deltaMode: 0
|
|
6636
6682
|
});
|
|
6637
6683
|
|
|
6684
|
+
var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
|
|
6685
|
+
|
|
6638
6686
|
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
|
|
6639
6687
|
|
|
6640
6688
|
var START_KEYCODE = 229;
|
|
@@ -6799,18 +6847,25 @@
|
|
|
6799
6847
|
}
|
|
6800
6848
|
}
|
|
6801
6849
|
|
|
6802
|
-
var
|
|
6803
|
-
accumulateTwoPhaseListeners(targetInst, dispatchQueue, event);
|
|
6850
|
+
var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
|
|
6804
6851
|
|
|
6805
|
-
if (
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6852
|
+
if (listeners.length > 0) {
|
|
6853
|
+
var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
|
|
6854
|
+
dispatchQueue.push({
|
|
6855
|
+
event: event,
|
|
6856
|
+
listeners: listeners
|
|
6857
|
+
});
|
|
6811
6858
|
|
|
6812
|
-
if (
|
|
6813
|
-
|
|
6859
|
+
if (fallbackData) {
|
|
6860
|
+
// Inject data generated from fallback path into the synthetic event.
|
|
6861
|
+
// This matches the property of native CompositionEventInterface.
|
|
6862
|
+
event.data = fallbackData;
|
|
6863
|
+
} else {
|
|
6864
|
+
var customData = getDataFromCustomEvent(nativeEvent);
|
|
6865
|
+
|
|
6866
|
+
if (customData !== null) {
|
|
6867
|
+
event.data = customData;
|
|
6868
|
+
}
|
|
6814
6869
|
}
|
|
6815
6870
|
}
|
|
6816
6871
|
}
|
|
@@ -6952,9 +7007,16 @@
|
|
|
6952
7007
|
return null;
|
|
6953
7008
|
}
|
|
6954
7009
|
|
|
6955
|
-
var
|
|
6956
|
-
|
|
6957
|
-
|
|
7010
|
+
var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');
|
|
7011
|
+
|
|
7012
|
+
if (listeners.length > 0) {
|
|
7013
|
+
var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);
|
|
7014
|
+
dispatchQueue.push({
|
|
7015
|
+
event: event,
|
|
7016
|
+
listeners: listeners
|
|
7017
|
+
});
|
|
7018
|
+
event.data = chars;
|
|
7019
|
+
}
|
|
6958
7020
|
}
|
|
6959
7021
|
/**
|
|
6960
7022
|
* Create an `onBeforeInput` event to match
|
|
@@ -7052,10 +7114,17 @@
|
|
|
7052
7114
|
}
|
|
7053
7115
|
|
|
7054
7116
|
function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
|
|
7055
|
-
|
|
7056
|
-
|
|
7117
|
+
// Flag this event loop as needing state restore.
|
|
7057
7118
|
enqueueStateRestore(target);
|
|
7058
|
-
accumulateTwoPhaseListeners(inst,
|
|
7119
|
+
var listeners = accumulateTwoPhaseListeners(inst, 'onChange');
|
|
7120
|
+
|
|
7121
|
+
if (listeners.length > 0) {
|
|
7122
|
+
var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);
|
|
7123
|
+
dispatchQueue.push({
|
|
7124
|
+
event: event,
|
|
7125
|
+
listeners: listeners
|
|
7126
|
+
});
|
|
7127
|
+
}
|
|
7059
7128
|
}
|
|
7060
7129
|
/**
|
|
7061
7130
|
* For IE shims
|
|
@@ -7365,13 +7434,13 @@
|
|
|
7365
7434
|
return;
|
|
7366
7435
|
}
|
|
7367
7436
|
|
|
7368
|
-
var
|
|
7437
|
+
var SyntheticEventCtor = SyntheticMouseEvent;
|
|
7369
7438
|
var leaveEventType = 'onMouseLeave';
|
|
7370
7439
|
var enterEventType = 'onMouseEnter';
|
|
7371
7440
|
var eventTypePrefix = 'mouse';
|
|
7372
7441
|
|
|
7373
7442
|
if (domEventName === 'pointerout' || domEventName === 'pointerover') {
|
|
7374
|
-
|
|
7443
|
+
SyntheticEventCtor = SyntheticPointerEvent;
|
|
7375
7444
|
leaveEventType = 'onPointerLeave';
|
|
7376
7445
|
enterEventType = 'onPointerEnter';
|
|
7377
7446
|
eventTypePrefix = 'pointer';
|
|
@@ -7379,7 +7448,7 @@
|
|
|
7379
7448
|
|
|
7380
7449
|
var fromNode = from == null ? win : getNodeFromInstance(from);
|
|
7381
7450
|
var toNode = to == null ? win : getNodeFromInstance(to);
|
|
7382
|
-
var leave = new
|
|
7451
|
+
var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);
|
|
7383
7452
|
leave.target = fromNode;
|
|
7384
7453
|
leave.relatedTarget = toNode;
|
|
7385
7454
|
var enter = null; // We should only process this nativeEvent if we are processing
|
|
@@ -7388,7 +7457,7 @@
|
|
|
7388
7457
|
var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
|
|
7389
7458
|
|
|
7390
7459
|
if (nativeTargetInst === targetInst) {
|
|
7391
|
-
var enterEvent = new
|
|
7460
|
+
var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);
|
|
7392
7461
|
enterEvent.target = toNode;
|
|
7393
7462
|
enterEvent.relatedTarget = fromNode;
|
|
7394
7463
|
enter = enterEvent;
|
|
@@ -7921,9 +7990,16 @@
|
|
|
7921
7990
|
|
|
7922
7991
|
if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
|
7923
7992
|
lastSelection = currentSelection;
|
|
7924
|
-
var
|
|
7925
|
-
|
|
7926
|
-
|
|
7993
|
+
var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');
|
|
7994
|
+
|
|
7995
|
+
if (listeners.length > 0) {
|
|
7996
|
+
var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);
|
|
7997
|
+
dispatchQueue.push({
|
|
7998
|
+
event: event,
|
|
7999
|
+
listeners: listeners
|
|
8000
|
+
});
|
|
8001
|
+
event.target = activeElement$1;
|
|
8002
|
+
}
|
|
7927
8003
|
}
|
|
7928
8004
|
}
|
|
7929
8005
|
/**
|
|
@@ -8005,7 +8081,7 @@
|
|
|
8005
8081
|
return;
|
|
8006
8082
|
}
|
|
8007
8083
|
|
|
8008
|
-
var
|
|
8084
|
+
var SyntheticEventCtor = SyntheticEvent;
|
|
8009
8085
|
var reactEventType = domEventName;
|
|
8010
8086
|
|
|
8011
8087
|
switch (domEventName) {
|
|
@@ -8021,22 +8097,22 @@
|
|
|
8021
8097
|
|
|
8022
8098
|
case 'keydown':
|
|
8023
8099
|
case 'keyup':
|
|
8024
|
-
|
|
8100
|
+
SyntheticEventCtor = SyntheticKeyboardEvent;
|
|
8025
8101
|
break;
|
|
8026
8102
|
|
|
8027
8103
|
case 'focusin':
|
|
8028
8104
|
reactEventType = 'focus';
|
|
8029
|
-
|
|
8105
|
+
SyntheticEventCtor = SyntheticFocusEvent;
|
|
8030
8106
|
break;
|
|
8031
8107
|
|
|
8032
8108
|
case 'focusout':
|
|
8033
8109
|
reactEventType = 'blur';
|
|
8034
|
-
|
|
8110
|
+
SyntheticEventCtor = SyntheticFocusEvent;
|
|
8035
8111
|
break;
|
|
8036
8112
|
|
|
8037
8113
|
case 'beforeblur':
|
|
8038
8114
|
case 'afterblur':
|
|
8039
|
-
|
|
8115
|
+
SyntheticEventCtor = SyntheticFocusEvent;
|
|
8040
8116
|
break;
|
|
8041
8117
|
|
|
8042
8118
|
case 'click':
|
|
@@ -8059,7 +8135,7 @@
|
|
|
8059
8135
|
case 'mouseout':
|
|
8060
8136
|
case 'mouseover':
|
|
8061
8137
|
case 'contextmenu':
|
|
8062
|
-
|
|
8138
|
+
SyntheticEventCtor = SyntheticMouseEvent;
|
|
8063
8139
|
break;
|
|
8064
8140
|
|
|
8065
8141
|
case 'drag':
|
|
@@ -8070,38 +8146,38 @@
|
|
|
8070
8146
|
case 'dragover':
|
|
8071
8147
|
case 'dragstart':
|
|
8072
8148
|
case 'drop':
|
|
8073
|
-
|
|
8149
|
+
SyntheticEventCtor = SyntheticDragEvent;
|
|
8074
8150
|
break;
|
|
8075
8151
|
|
|
8076
8152
|
case 'touchcancel':
|
|
8077
8153
|
case 'touchend':
|
|
8078
8154
|
case 'touchmove':
|
|
8079
8155
|
case 'touchstart':
|
|
8080
|
-
|
|
8156
|
+
SyntheticEventCtor = SyntheticTouchEvent;
|
|
8081
8157
|
break;
|
|
8082
8158
|
|
|
8083
8159
|
case ANIMATION_END:
|
|
8084
8160
|
case ANIMATION_ITERATION:
|
|
8085
8161
|
case ANIMATION_START:
|
|
8086
|
-
|
|
8162
|
+
SyntheticEventCtor = SyntheticAnimationEvent;
|
|
8087
8163
|
break;
|
|
8088
8164
|
|
|
8089
8165
|
case TRANSITION_END:
|
|
8090
|
-
|
|
8166
|
+
SyntheticEventCtor = SyntheticTransitionEvent;
|
|
8091
8167
|
break;
|
|
8092
8168
|
|
|
8093
8169
|
case 'scroll':
|
|
8094
|
-
|
|
8170
|
+
SyntheticEventCtor = SyntheticUIEvent;
|
|
8095
8171
|
break;
|
|
8096
8172
|
|
|
8097
8173
|
case 'wheel':
|
|
8098
|
-
|
|
8174
|
+
SyntheticEventCtor = SyntheticWheelEvent;
|
|
8099
8175
|
break;
|
|
8100
8176
|
|
|
8101
8177
|
case 'copy':
|
|
8102
8178
|
case 'cut':
|
|
8103
8179
|
case 'paste':
|
|
8104
|
-
|
|
8180
|
+
SyntheticEventCtor = SyntheticClipboardEvent;
|
|
8105
8181
|
break;
|
|
8106
8182
|
|
|
8107
8183
|
case 'gotpointercapture':
|
|
@@ -8112,11 +8188,10 @@
|
|
|
8112
8188
|
case 'pointerout':
|
|
8113
8189
|
case 'pointerover':
|
|
8114
8190
|
case 'pointerup':
|
|
8115
|
-
|
|
8191
|
+
SyntheticEventCtor = SyntheticPointerEvent;
|
|
8116
8192
|
break;
|
|
8117
8193
|
}
|
|
8118
8194
|
|
|
8119
|
-
var event = new SyntheticEvent(reactName, reactEventType, null, nativeEvent, nativeEventTarget, EventInterface);
|
|
8120
8195
|
var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
|
|
8121
8196
|
|
|
8122
8197
|
{
|
|
@@ -8124,16 +8199,23 @@
|
|
|
8124
8199
|
// In the past, React has always bubbled them, but this can be surprising.
|
|
8125
8200
|
// We're going to try aligning closer to the browser behavior by not bubbling
|
|
8126
8201
|
// them in React either. We'll start by not bubbling onScroll, and then expand.
|
|
8127
|
-
var accumulateTargetOnly =
|
|
8202
|
+
var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
|
|
8203
|
+
// nonDelegatedEvents list in DOMPluginEventSystem.
|
|
8204
|
+
// Then we can remove this special list.
|
|
8205
|
+
// This is a breaking change that can wait until React 18.
|
|
8206
|
+
domEventName === 'scroll';
|
|
8128
8207
|
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
//
|
|
8133
|
-
|
|
8134
|
-
}
|
|
8208
|
+
var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
|
|
8209
|
+
|
|
8210
|
+
if (_listeners.length > 0) {
|
|
8211
|
+
// Intentionally create event lazily.
|
|
8212
|
+
var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
|
|
8135
8213
|
|
|
8136
|
-
|
|
8214
|
+
dispatchQueue.push({
|
|
8215
|
+
event: _event,
|
|
8216
|
+
listeners: _listeners
|
|
8217
|
+
});
|
|
8218
|
+
}
|
|
8137
8219
|
}
|
|
8138
8220
|
}
|
|
8139
8221
|
|
|
@@ -8247,22 +8329,14 @@
|
|
|
8247
8329
|
processDispatchQueue(dispatchQueue, eventSystemFlags);
|
|
8248
8330
|
}
|
|
8249
8331
|
|
|
8250
|
-
function shouldUpgradeListener(listenerEntry, passive) {
|
|
8251
|
-
return listenerEntry !== undefined && listenerEntry.passive === true && !passive;
|
|
8252
|
-
}
|
|
8253
|
-
|
|
8254
8332
|
function listenToNonDelegatedEvent(domEventName, targetElement) {
|
|
8255
8333
|
var isCapturePhaseListener = false;
|
|
8256
|
-
var
|
|
8257
|
-
var
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
listenerMap.set(listenerMapKey, {
|
|
8263
|
-
passive: false,
|
|
8264
|
-
listener: listener
|
|
8265
|
-
});
|
|
8334
|
+
var listenerSet = getEventListenerSet(targetElement);
|
|
8335
|
+
var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
|
|
8336
|
+
|
|
8337
|
+
if (!listenerSet.has(listenerSetKey)) {
|
|
8338
|
+
addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
|
|
8339
|
+
listenerSet.add(listenerSetKey);
|
|
8266
8340
|
}
|
|
8267
8341
|
}
|
|
8268
8342
|
var listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);
|
|
@@ -8286,26 +8360,14 @@
|
|
|
8286
8360
|
});
|
|
8287
8361
|
}
|
|
8288
8362
|
}
|
|
8289
|
-
function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement
|
|
8290
|
-
var eventSystemFlags = arguments.length >
|
|
8363
|
+
function listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {
|
|
8364
|
+
var eventSystemFlags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8291
8365
|
var target = rootContainerElement; // selectionchange needs to be attached to the document
|
|
8292
8366
|
// otherwise it won't capture incoming events that are only
|
|
8293
8367
|
// triggered on the document directly.
|
|
8294
8368
|
|
|
8295
8369
|
if (domEventName === 'selectionchange' && rootContainerElement.nodeType !== DOCUMENT_NODE) {
|
|
8296
8370
|
target = rootContainerElement.ownerDocument;
|
|
8297
|
-
}
|
|
8298
|
-
|
|
8299
|
-
if ( isPassiveListener === undefined) {
|
|
8300
|
-
// Browsers introduced an intervention, making these events
|
|
8301
|
-
// passive by default on document. React doesn't bind them
|
|
8302
|
-
// to document anymore, but changing this now would undo
|
|
8303
|
-
// the performance wins from the change. So we emulate
|
|
8304
|
-
// the existing behavior manually on the roots now.
|
|
8305
|
-
// https://github.com/facebook/react/issues/19651
|
|
8306
|
-
if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {
|
|
8307
|
-
isPassiveListener = true;
|
|
8308
|
-
}
|
|
8309
8371
|
} // If the event can be delegated (or is capture phase), we can
|
|
8310
8372
|
// register it to the root container. Otherwise, we should
|
|
8311
8373
|
// register the event to the target element and mark it as
|
|
@@ -8330,42 +8392,42 @@
|
|
|
8330
8392
|
target = targetElement;
|
|
8331
8393
|
}
|
|
8332
8394
|
|
|
8333
|
-
var
|
|
8334
|
-
var
|
|
8335
|
-
var listenerEntry = listenerMap.get(listenerMapKey);
|
|
8336
|
-
var shouldUpgrade = shouldUpgradeListener(listenerEntry, isPassiveListener); // If the listener entry is empty or we should upgrade, then
|
|
8395
|
+
var listenerSet = getEventListenerSet(target);
|
|
8396
|
+
var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); // If the listener entry is empty or we should upgrade, then
|
|
8337
8397
|
// we need to trap an event listener onto the target.
|
|
8338
8398
|
|
|
8339
|
-
if (
|
|
8340
|
-
// If we should upgrade, then we need to remove the existing trapped
|
|
8341
|
-
// event listener for the target container.
|
|
8342
|
-
if (shouldUpgrade) {
|
|
8343
|
-
removeEventListener(target, domEventName, listenerEntry.listener, isCapturePhaseListener);
|
|
8344
|
-
}
|
|
8345
|
-
|
|
8399
|
+
if (!listenerSet.has(listenerSetKey)) {
|
|
8346
8400
|
if (isCapturePhaseListener) {
|
|
8347
8401
|
eventSystemFlags |= IS_CAPTURE_PHASE;
|
|
8348
8402
|
}
|
|
8349
8403
|
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
passive: isPassiveListener,
|
|
8353
|
-
listener: listener
|
|
8354
|
-
});
|
|
8404
|
+
addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
|
|
8405
|
+
listenerSet.add(listenerSetKey);
|
|
8355
8406
|
}
|
|
8356
8407
|
}
|
|
8357
8408
|
|
|
8358
|
-
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport
|
|
8359
|
-
var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags
|
|
8409
|
+
function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
|
|
8410
|
+
var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be
|
|
8360
8411
|
// active and not passive.
|
|
8361
8412
|
|
|
8362
|
-
|
|
8363
|
-
|
|
8413
|
+
var isPassiveListener = undefined;
|
|
8414
|
+
|
|
8415
|
+
if (passiveBrowserEventsSupported) {
|
|
8416
|
+
// Browsers introduced an intervention, making these events
|
|
8417
|
+
// passive by default on document. React doesn't bind them
|
|
8418
|
+
// to document anymore, but changing this now would undo
|
|
8419
|
+
// the performance wins from the change. So we emulate
|
|
8420
|
+
// the existing behavior manually on the roots now.
|
|
8421
|
+
// https://github.com/facebook/react/issues/19651
|
|
8422
|
+
if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {
|
|
8423
|
+
isPassiveListener = true;
|
|
8424
|
+
}
|
|
8364
8425
|
}
|
|
8365
8426
|
|
|
8366
8427
|
targetContainer = targetContainer;
|
|
8367
8428
|
var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we
|
|
8368
8429
|
|
|
8430
|
+
|
|
8369
8431
|
if (isCapturePhaseListener) {
|
|
8370
8432
|
if (isPassiveListener !== undefined) {
|
|
8371
8433
|
unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
|
|
@@ -8379,8 +8441,6 @@
|
|
|
8379
8441
|
unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
|
|
8380
8442
|
}
|
|
8381
8443
|
}
|
|
8382
|
-
|
|
8383
|
-
return unsubscribeListener;
|
|
8384
8444
|
}
|
|
8385
8445
|
|
|
8386
8446
|
function isMatchingRootContainer(grandContainer, targetContainer) {
|
|
@@ -8487,19 +8547,12 @@
|
|
|
8487
8547
|
};
|
|
8488
8548
|
}
|
|
8489
8549
|
|
|
8490
|
-
function
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
listeners: listeners
|
|
8494
|
-
};
|
|
8495
|
-
}
|
|
8496
|
-
|
|
8497
|
-
function accumulateSinglePhaseListeners(targetFiber, dispatchQueue, event, inCapturePhase, accumulateTargetOnly) {
|
|
8498
|
-
var bubbled = event._reactName;
|
|
8499
|
-
var captured = bubbled !== null ? bubbled + 'Capture' : null;
|
|
8550
|
+
function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {
|
|
8551
|
+
var captureName = reactName !== null ? reactName + 'Capture' : null;
|
|
8552
|
+
var reactEventName = inCapturePhase ? captureName : reactName;
|
|
8500
8553
|
var listeners = [];
|
|
8501
8554
|
var instance = targetFiber;
|
|
8502
|
-
var
|
|
8555
|
+
var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path.
|
|
8503
8556
|
|
|
8504
8557
|
while (instance !== null) {
|
|
8505
8558
|
var _instance2 = instance,
|
|
@@ -8507,22 +8560,14 @@
|
|
|
8507
8560
|
tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>)
|
|
8508
8561
|
|
|
8509
8562
|
if (tag === HostComponent && stateNode !== null) {
|
|
8510
|
-
|
|
8511
|
-
|
|
8563
|
+
lastHostComponent = stateNode; // createEventHandle listeners
|
|
8512
8564
|
|
|
8513
|
-
if (captured !== null && inCapturePhase) {
|
|
8514
|
-
var captureListener = getListener(instance, captured);
|
|
8515
8565
|
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
}
|
|
8519
|
-
}
|
|
8566
|
+
if (reactEventName !== null) {
|
|
8567
|
+
var listener = getListener(instance, reactEventName);
|
|
8520
8568
|
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
if (bubbleListener != null) {
|
|
8525
|
-
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
8569
|
+
if (listener != null) {
|
|
8570
|
+
listeners.push(createDispatchListener(instance, listener, lastHostComponent));
|
|
8526
8571
|
}
|
|
8527
8572
|
}
|
|
8528
8573
|
} // If we are only accumulating events for the target, then we don't
|
|
@@ -8537,9 +8582,7 @@
|
|
|
8537
8582
|
instance = instance.return;
|
|
8538
8583
|
}
|
|
8539
8584
|
|
|
8540
|
-
|
|
8541
|
-
dispatchQueue.push(createDispatchEntry(event, listeners));
|
|
8542
|
-
}
|
|
8585
|
+
return listeners;
|
|
8543
8586
|
} // We should only use this function for:
|
|
8544
8587
|
// - BeforeInputEventPlugin
|
|
8545
8588
|
// - ChangeEventPlugin
|
|
@@ -8548,9 +8591,8 @@
|
|
|
8548
8591
|
// in the bubble phase, so we need to accumulate two
|
|
8549
8592
|
// phase event listeners (via emulation).
|
|
8550
8593
|
|
|
8551
|
-
function accumulateTwoPhaseListeners(targetFiber,
|
|
8552
|
-
var
|
|
8553
|
-
var captured = bubbled !== null ? bubbled + 'Capture' : null;
|
|
8594
|
+
function accumulateTwoPhaseListeners(targetFiber, reactName) {
|
|
8595
|
+
var captureName = reactName + 'Capture';
|
|
8554
8596
|
var listeners = [];
|
|
8555
8597
|
var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.
|
|
8556
8598
|
|
|
@@ -8560,31 +8602,24 @@
|
|
|
8560
8602
|
tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)
|
|
8561
8603
|
|
|
8562
8604
|
if (tag === HostComponent && stateNode !== null) {
|
|
8563
|
-
var currentTarget = stateNode;
|
|
8564
|
-
|
|
8565
|
-
if (captured !== null) {
|
|
8566
|
-
var captureListener = getListener(instance, captured);
|
|
8605
|
+
var currentTarget = stateNode;
|
|
8606
|
+
var captureListener = getListener(instance, captureName);
|
|
8567
8607
|
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
}
|
|
8608
|
+
if (captureListener != null) {
|
|
8609
|
+
listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
|
|
8571
8610
|
}
|
|
8572
8611
|
|
|
8573
|
-
|
|
8574
|
-
var bubbleListener = getListener(instance, bubbled);
|
|
8612
|
+
var bubbleListener = getListener(instance, reactName);
|
|
8575
8613
|
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
}
|
|
8614
|
+
if (bubbleListener != null) {
|
|
8615
|
+
listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
|
|
8579
8616
|
}
|
|
8580
8617
|
}
|
|
8581
8618
|
|
|
8582
8619
|
instance = instance.return;
|
|
8583
8620
|
}
|
|
8584
8621
|
|
|
8585
|
-
|
|
8586
|
-
dispatchQueue.push(createDispatchEntry(event, listeners));
|
|
8587
|
-
}
|
|
8622
|
+
return listeners;
|
|
8588
8623
|
}
|
|
8589
8624
|
|
|
8590
8625
|
function getParent(inst) {
|
|
@@ -8695,7 +8730,10 @@
|
|
|
8695
8730
|
}
|
|
8696
8731
|
|
|
8697
8732
|
if (listeners.length !== 0) {
|
|
8698
|
-
dispatchQueue.push(
|
|
8733
|
+
dispatchQueue.push({
|
|
8734
|
+
event: event,
|
|
8735
|
+
listeners: listeners
|
|
8736
|
+
});
|
|
8699
8737
|
}
|
|
8700
8738
|
} // We should only use this function for:
|
|
8701
8739
|
// - EnterLeaveEventPlugin
|
|
@@ -8715,7 +8753,7 @@
|
|
|
8715
8753
|
accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
|
|
8716
8754
|
}
|
|
8717
8755
|
}
|
|
8718
|
-
function
|
|
8756
|
+
function getListenerSetKey(domEventName, capture) {
|
|
8719
8757
|
return domEventName + "__" + (capture ? 'capture' : 'bubble');
|
|
8720
8758
|
}
|
|
8721
8759
|
|
|
@@ -8741,11 +8779,6 @@
|
|
|
8741
8779
|
|
|
8742
8780
|
{
|
|
8743
8781
|
warnedUnknownTags = {
|
|
8744
|
-
// Chrome is the only major browser not shipping <time>. But as of July
|
|
8745
|
-
// 2017 it intends to ship it due to widespread usage. We intentionally
|
|
8746
|
-
// *don't* warn for <time> even if it's unrecognized by Chrome because
|
|
8747
|
-
// it soon will be, and many apps have been using it anyway.
|
|
8748
|
-
time: true,
|
|
8749
8782
|
// There are working polyfills for <dialog>. Let people use it.
|
|
8750
8783
|
dialog: true,
|
|
8751
8784
|
// Electron ships a custom <webview> tag to display external web content in
|
|
@@ -9556,6 +9589,10 @@
|
|
|
9556
9589
|
if ( typeof nextProp !== 'function') {
|
|
9557
9590
|
warnForInvalidEventListener(propKey, nextProp);
|
|
9558
9591
|
}
|
|
9592
|
+
|
|
9593
|
+
if (propKey === 'onScroll') {
|
|
9594
|
+
listenToNonDelegatedEvent('scroll', domElement);
|
|
9595
|
+
}
|
|
9559
9596
|
}
|
|
9560
9597
|
} else if ( // Convince Flow we've calculated it (it's DEV-only in this method.)
|
|
9561
9598
|
typeof isCustomComponentTag === 'boolean') {
|
|
@@ -10689,14 +10726,14 @@
|
|
|
10689
10726
|
function updateFiberProps(node, props) {
|
|
10690
10727
|
node[internalPropsKey] = props;
|
|
10691
10728
|
}
|
|
10692
|
-
function
|
|
10693
|
-
var
|
|
10729
|
+
function getEventListenerSet(node) {
|
|
10730
|
+
var elementListenerSet = node[internalEventHandlersKey];
|
|
10694
10731
|
|
|
10695
|
-
if (
|
|
10696
|
-
|
|
10732
|
+
if (elementListenerSet === undefined) {
|
|
10733
|
+
elementListenerSet = node[internalEventHandlersKey] = new Set();
|
|
10697
10734
|
}
|
|
10698
10735
|
|
|
10699
|
-
return
|
|
10736
|
+
return elementListenerSet;
|
|
10700
10737
|
}
|
|
10701
10738
|
|
|
10702
10739
|
var loggedTypeFailures = {};
|
|
@@ -11124,7 +11161,7 @@
|
|
|
11124
11161
|
function onCommitRoot(root, priorityLevel) {
|
|
11125
11162
|
if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {
|
|
11126
11163
|
try {
|
|
11127
|
-
var didError = (root.current.
|
|
11164
|
+
var didError = (root.current.flags & DidCapture) === DidCapture;
|
|
11128
11165
|
|
|
11129
11166
|
if (enableProfilerTimer) {
|
|
11130
11167
|
injectedHook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
|
|
@@ -11339,7 +11376,7 @@
|
|
|
11339
11376
|
}
|
|
11340
11377
|
|
|
11341
11378
|
// TODO: this is special because it gets imported during build.
|
|
11342
|
-
var ReactVersion = '17.0.
|
|
11379
|
+
var ReactVersion = '17.0.1';
|
|
11343
11380
|
|
|
11344
11381
|
var NoMode = 0;
|
|
11345
11382
|
var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
|
|
@@ -11350,6 +11387,12 @@
|
|
|
11350
11387
|
var ProfileMode = 8;
|
|
11351
11388
|
var DebugTracingMode = 16;
|
|
11352
11389
|
|
|
11390
|
+
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
11391
|
+
var NoTransition = 0;
|
|
11392
|
+
function requestCurrentTransition() {
|
|
11393
|
+
return ReactCurrentBatchConfig.transition;
|
|
11394
|
+
}
|
|
11395
|
+
|
|
11353
11396
|
var ReactStrictModeWarnings = {
|
|
11354
11397
|
recordUnsafeLifecycleWarnings: function (fiber, instance) {},
|
|
11355
11398
|
flushPendingUnsafeLifecycleWarnings: function () {},
|
|
@@ -12071,7 +12114,7 @@
|
|
|
12071
12114
|
|
|
12072
12115
|
case CaptureUpdate:
|
|
12073
12116
|
{
|
|
12074
|
-
workInProgress.
|
|
12117
|
+
workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;
|
|
12075
12118
|
}
|
|
12076
12119
|
// Intentional fallthrough
|
|
12077
12120
|
|
|
@@ -12238,7 +12281,7 @@
|
|
|
12238
12281
|
var callback = update.callback;
|
|
12239
12282
|
|
|
12240
12283
|
if (callback !== null) {
|
|
12241
|
-
workInProgress.
|
|
12284
|
+
workInProgress.flags |= Callback;
|
|
12242
12285
|
var effects = queue.effects;
|
|
12243
12286
|
|
|
12244
12287
|
if (effects === null) {
|
|
@@ -12329,11 +12372,6 @@
|
|
|
12329
12372
|
}
|
|
12330
12373
|
}
|
|
12331
12374
|
|
|
12332
|
-
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
12333
|
-
function requestCurrentSuspenseConfig() {
|
|
12334
|
-
return ReactCurrentBatchConfig.suspense;
|
|
12335
|
-
}
|
|
12336
|
-
|
|
12337
12375
|
var fakeInternalInstance = {};
|
|
12338
12376
|
var isArray = Array.isArray; // React.Component uses a shared frozen object by default.
|
|
12339
12377
|
// We'll use it to determine whether we need to initialize legacy refs.
|
|
@@ -12443,8 +12481,7 @@
|
|
|
12443
12481
|
enqueueSetState: function (inst, payload, callback) {
|
|
12444
12482
|
var fiber = get(inst);
|
|
12445
12483
|
var eventTime = requestEventTime();
|
|
12446
|
-
var
|
|
12447
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
12484
|
+
var lane = requestUpdateLane(fiber);
|
|
12448
12485
|
var update = createUpdate(eventTime, lane);
|
|
12449
12486
|
update.payload = payload;
|
|
12450
12487
|
|
|
@@ -12462,8 +12499,7 @@
|
|
|
12462
12499
|
enqueueReplaceState: function (inst, payload, callback) {
|
|
12463
12500
|
var fiber = get(inst);
|
|
12464
12501
|
var eventTime = requestEventTime();
|
|
12465
|
-
var
|
|
12466
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
12502
|
+
var lane = requestUpdateLane(fiber);
|
|
12467
12503
|
var update = createUpdate(eventTime, lane);
|
|
12468
12504
|
update.tag = ReplaceState;
|
|
12469
12505
|
update.payload = payload;
|
|
@@ -12482,8 +12518,7 @@
|
|
|
12482
12518
|
enqueueForceUpdate: function (inst, callback) {
|
|
12483
12519
|
var fiber = get(inst);
|
|
12484
12520
|
var eventTime = requestEventTime();
|
|
12485
|
-
var
|
|
12486
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
12521
|
+
var lane = requestUpdateLane(fiber);
|
|
12487
12522
|
var update = createUpdate(eventTime, lane);
|
|
12488
12523
|
update.tag = ForceUpdate;
|
|
12489
12524
|
|
|
@@ -12878,7 +12913,7 @@
|
|
|
12878
12913
|
}
|
|
12879
12914
|
|
|
12880
12915
|
if (typeof instance.componentDidMount === 'function') {
|
|
12881
|
-
workInProgress.
|
|
12916
|
+
workInProgress.flags |= Update;
|
|
12882
12917
|
}
|
|
12883
12918
|
}
|
|
12884
12919
|
|
|
@@ -12920,7 +12955,7 @@
|
|
|
12920
12955
|
// If an update was already in progress, we should schedule an Update
|
|
12921
12956
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
12922
12957
|
if (typeof instance.componentDidMount === 'function') {
|
|
12923
|
-
workInProgress.
|
|
12958
|
+
workInProgress.flags |= Update;
|
|
12924
12959
|
}
|
|
12925
12960
|
|
|
12926
12961
|
return false;
|
|
@@ -12947,13 +12982,13 @@
|
|
|
12947
12982
|
}
|
|
12948
12983
|
|
|
12949
12984
|
if (typeof instance.componentDidMount === 'function') {
|
|
12950
|
-
workInProgress.
|
|
12985
|
+
workInProgress.flags |= Update;
|
|
12951
12986
|
}
|
|
12952
12987
|
} else {
|
|
12953
12988
|
// If an update was already in progress, we should schedule an Update
|
|
12954
12989
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
12955
12990
|
if (typeof instance.componentDidMount === 'function') {
|
|
12956
|
-
workInProgress.
|
|
12991
|
+
workInProgress.flags |= Update;
|
|
12957
12992
|
} // If shouldComponentUpdate returned false, we should still update the
|
|
12958
12993
|
// memoized state to indicate that this work can be reused.
|
|
12959
12994
|
|
|
@@ -13013,13 +13048,13 @@
|
|
|
13013
13048
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
13014
13049
|
if (typeof instance.componentDidUpdate === 'function') {
|
|
13015
13050
|
if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
|
13016
|
-
workInProgress.
|
|
13051
|
+
workInProgress.flags |= Update;
|
|
13017
13052
|
}
|
|
13018
13053
|
}
|
|
13019
13054
|
|
|
13020
13055
|
if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
|
13021
13056
|
if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
|
13022
|
-
workInProgress.
|
|
13057
|
+
workInProgress.flags |= Snapshot;
|
|
13023
13058
|
}
|
|
13024
13059
|
}
|
|
13025
13060
|
|
|
@@ -13047,24 +13082,24 @@
|
|
|
13047
13082
|
}
|
|
13048
13083
|
|
|
13049
13084
|
if (typeof instance.componentDidUpdate === 'function') {
|
|
13050
|
-
workInProgress.
|
|
13085
|
+
workInProgress.flags |= Update;
|
|
13051
13086
|
}
|
|
13052
13087
|
|
|
13053
13088
|
if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
|
13054
|
-
workInProgress.
|
|
13089
|
+
workInProgress.flags |= Snapshot;
|
|
13055
13090
|
}
|
|
13056
13091
|
} else {
|
|
13057
13092
|
// If an update was already in progress, we should schedule an Update
|
|
13058
13093
|
// effect even though we're bailing out, so that cWU/cDU are called.
|
|
13059
13094
|
if (typeof instance.componentDidUpdate === 'function') {
|
|
13060
13095
|
if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
|
13061
|
-
workInProgress.
|
|
13096
|
+
workInProgress.flags |= Update;
|
|
13062
13097
|
}
|
|
13063
13098
|
}
|
|
13064
13099
|
|
|
13065
13100
|
if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
|
13066
13101
|
if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
|
13067
|
-
workInProgress.
|
|
13102
|
+
workInProgress.flags |= Snapshot;
|
|
13068
13103
|
}
|
|
13069
13104
|
} // If shouldComponentUpdate returned false, we should still update the
|
|
13070
13105
|
// memoized props/state to indicate that this work can be reused.
|
|
@@ -13269,7 +13304,7 @@
|
|
|
13269
13304
|
}
|
|
13270
13305
|
|
|
13271
13306
|
childToDelete.nextEffect = null;
|
|
13272
|
-
childToDelete.
|
|
13307
|
+
childToDelete.flags = Deletion;
|
|
13273
13308
|
}
|
|
13274
13309
|
|
|
13275
13310
|
function deleteRemainingChildren(returnFiber, currentFirstChild) {
|
|
@@ -13334,7 +13369,7 @@
|
|
|
13334
13369
|
|
|
13335
13370
|
if (oldIndex < lastPlacedIndex) {
|
|
13336
13371
|
// This is a move.
|
|
13337
|
-
newFiber.
|
|
13372
|
+
newFiber.flags = Placement;
|
|
13338
13373
|
return lastPlacedIndex;
|
|
13339
13374
|
} else {
|
|
13340
13375
|
// This item can stay in place.
|
|
@@ -13342,7 +13377,7 @@
|
|
|
13342
13377
|
}
|
|
13343
13378
|
} else {
|
|
13344
13379
|
// This is an insertion.
|
|
13345
|
-
newFiber.
|
|
13380
|
+
newFiber.flags = Placement;
|
|
13346
13381
|
return lastPlacedIndex;
|
|
13347
13382
|
}
|
|
13348
13383
|
}
|
|
@@ -13351,7 +13386,7 @@
|
|
|
13351
13386
|
// This is simpler for the single child case. We only need to do a
|
|
13352
13387
|
// placement for inserting new children.
|
|
13353
13388
|
if (shouldTrackSideEffects && newFiber.alternate === null) {
|
|
13354
|
-
newFiber.
|
|
13389
|
+
newFiber.flags = Placement;
|
|
13355
13390
|
}
|
|
13356
13391
|
|
|
13357
13392
|
return newFiber;
|
|
@@ -14325,13 +14360,6 @@
|
|
|
14325
14360
|
pop(suspenseStackCursor, fiber);
|
|
14326
14361
|
}
|
|
14327
14362
|
|
|
14328
|
-
// A non-null SuspenseState means that it is blocked for one reason or another.
|
|
14329
|
-
// - A non-null dehydrated field means it's blocked pending hydration.
|
|
14330
|
-
// - A non-null dehydrated field can use isSuspenseInstancePending or
|
|
14331
|
-
// isSuspenseInstanceFallback to query the reason for being dehydrated.
|
|
14332
|
-
// - A null dehydrated field means it's blocked by something suspending and
|
|
14333
|
-
// we're currently showing a fallback instead.
|
|
14334
|
-
|
|
14335
14363
|
function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
|
|
14336
14364
|
// If it was the primary children that just suspended, capture and render the
|
|
14337
14365
|
// fallback. Otherwise, don't capture and bubble to the next boundary.
|
|
@@ -14383,7 +14411,7 @@
|
|
|
14383
14411
|
} else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
|
|
14384
14412
|
// keep track of whether it suspended or not.
|
|
14385
14413
|
node.memoizedProps.revealOrder !== undefined) {
|
|
14386
|
-
var didSuspend = (node.
|
|
14414
|
+
var didSuspend = (node.flags & DidCapture) !== NoFlags;
|
|
14387
14415
|
|
|
14388
14416
|
if (didSuspend) {
|
|
14389
14417
|
return node;
|
|
@@ -14413,7 +14441,7 @@
|
|
|
14413
14441
|
return null;
|
|
14414
14442
|
}
|
|
14415
14443
|
|
|
14416
|
-
var
|
|
14444
|
+
var NoFlags$1 =
|
|
14417
14445
|
/* */
|
|
14418
14446
|
0; // Represents whether effect should fire.
|
|
14419
14447
|
|
|
@@ -14459,7 +14487,7 @@
|
|
|
14459
14487
|
var childToDelete = createFiberFromHostInstanceForDeletion();
|
|
14460
14488
|
childToDelete.stateNode = instance;
|
|
14461
14489
|
childToDelete.return = returnFiber;
|
|
14462
|
-
childToDelete.
|
|
14490
|
+
childToDelete.flags = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
|
|
14463
14491
|
// these children are not part of the reconciliation list of children.
|
|
14464
14492
|
// Even if we abort and rereconcile the children, that will try to hydrate
|
|
14465
14493
|
// again and the nodes are still in the host tree so these will be
|
|
@@ -14474,7 +14502,7 @@
|
|
|
14474
14502
|
}
|
|
14475
14503
|
|
|
14476
14504
|
function insertNonHydratedInstance(returnFiber, fiber) {
|
|
14477
|
-
fiber.
|
|
14505
|
+
fiber.flags = fiber.flags & ~Hydrating | Placement;
|
|
14478
14506
|
|
|
14479
14507
|
{
|
|
14480
14508
|
switch (returnFiber.tag) {
|
|
@@ -15057,7 +15085,7 @@
|
|
|
15057
15085
|
}
|
|
15058
15086
|
function bailoutHooks(current, workInProgress, lanes) {
|
|
15059
15087
|
workInProgress.updateQueue = current.updateQueue;
|
|
15060
|
-
workInProgress.
|
|
15088
|
+
workInProgress.flags &= ~(Passive | Update);
|
|
15061
15089
|
current.lanes = removeLanes(current.lanes, lanes);
|
|
15062
15090
|
}
|
|
15063
15091
|
function resetHooksAfterThrow() {
|
|
@@ -15528,8 +15556,7 @@
|
|
|
15528
15556
|
|
|
15529
15557
|
if (!objectIs(snapshot, maybeNewSnapshot)) {
|
|
15530
15558
|
setSnapshot(maybeNewSnapshot);
|
|
15531
|
-
var
|
|
15532
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
15559
|
+
var lane = requestUpdateLane(fiber);
|
|
15533
15560
|
markRootMutableRead(root, lane);
|
|
15534
15561
|
} // If the source mutated between render and now,
|
|
15535
15562
|
// there may be state updates already scheduled from the old source.
|
|
@@ -15548,8 +15575,7 @@
|
|
|
15548
15575
|
try {
|
|
15549
15576
|
latestSetSnapshot(latestGetSnapshot(source._source)); // Record a pending mutable source update with the same expiration time.
|
|
15550
15577
|
|
|
15551
|
-
var
|
|
15552
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
15578
|
+
var lane = requestUpdateLane(fiber);
|
|
15553
15579
|
markRootMutableRead(root, lane);
|
|
15554
15580
|
} catch (error) {
|
|
15555
15581
|
// A selector might throw after a source mutation.
|
|
@@ -15699,14 +15725,14 @@
|
|
|
15699
15725
|
return hook.memoizedState;
|
|
15700
15726
|
}
|
|
15701
15727
|
|
|
15702
|
-
function mountEffectImpl(
|
|
15728
|
+
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
15703
15729
|
var hook = mountWorkInProgressHook();
|
|
15704
15730
|
var nextDeps = deps === undefined ? null : deps;
|
|
15705
|
-
currentlyRenderingFiber$1.
|
|
15706
|
-
hook.memoizedState = pushEffect(HasEffect |
|
|
15731
|
+
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
15732
|
+
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);
|
|
15707
15733
|
}
|
|
15708
15734
|
|
|
15709
|
-
function updateEffectImpl(
|
|
15735
|
+
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
15710
15736
|
var hook = updateWorkInProgressHook();
|
|
15711
15737
|
var nextDeps = deps === undefined ? null : deps;
|
|
15712
15738
|
var destroy = undefined;
|
|
@@ -15719,14 +15745,14 @@
|
|
|
15719
15745
|
var prevDeps = prevEffect.deps;
|
|
15720
15746
|
|
|
15721
15747
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
15722
|
-
pushEffect(
|
|
15748
|
+
pushEffect(hookFlags, create, destroy, nextDeps);
|
|
15723
15749
|
return;
|
|
15724
15750
|
}
|
|
15725
15751
|
}
|
|
15726
15752
|
}
|
|
15727
15753
|
|
|
15728
|
-
currentlyRenderingFiber$1.
|
|
15729
|
-
hook.memoizedState = pushEffect(HasEffect |
|
|
15754
|
+
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
15755
|
+
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
|
|
15730
15756
|
}
|
|
15731
15757
|
|
|
15732
15758
|
function mountEffect(create, deps) {
|
|
@@ -15873,61 +15899,61 @@
|
|
|
15873
15899
|
return nextValue;
|
|
15874
15900
|
}
|
|
15875
15901
|
|
|
15876
|
-
function mountDeferredValue(value
|
|
15902
|
+
function mountDeferredValue(value) {
|
|
15877
15903
|
var _mountState = mountState(value),
|
|
15878
15904
|
prevValue = _mountState[0],
|
|
15879
15905
|
setValue = _mountState[1];
|
|
15880
15906
|
|
|
15881
15907
|
mountEffect(function () {
|
|
15882
|
-
var
|
|
15883
|
-
ReactCurrentBatchConfig$1.
|
|
15908
|
+
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
15909
|
+
ReactCurrentBatchConfig$1.transition = 1;
|
|
15884
15910
|
|
|
15885
15911
|
try {
|
|
15886
15912
|
setValue(value);
|
|
15887
15913
|
} finally {
|
|
15888
|
-
ReactCurrentBatchConfig$1.
|
|
15914
|
+
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
15889
15915
|
}
|
|
15890
|
-
}, [value
|
|
15916
|
+
}, [value]);
|
|
15891
15917
|
return prevValue;
|
|
15892
15918
|
}
|
|
15893
15919
|
|
|
15894
|
-
function updateDeferredValue(value
|
|
15920
|
+
function updateDeferredValue(value) {
|
|
15895
15921
|
var _updateState = updateState(),
|
|
15896
15922
|
prevValue = _updateState[0],
|
|
15897
15923
|
setValue = _updateState[1];
|
|
15898
15924
|
|
|
15899
15925
|
updateEffect(function () {
|
|
15900
|
-
var
|
|
15901
|
-
ReactCurrentBatchConfig$1.
|
|
15926
|
+
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
15927
|
+
ReactCurrentBatchConfig$1.transition = 1;
|
|
15902
15928
|
|
|
15903
15929
|
try {
|
|
15904
15930
|
setValue(value);
|
|
15905
15931
|
} finally {
|
|
15906
|
-
ReactCurrentBatchConfig$1.
|
|
15932
|
+
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
15907
15933
|
}
|
|
15908
|
-
}, [value
|
|
15934
|
+
}, [value]);
|
|
15909
15935
|
return prevValue;
|
|
15910
15936
|
}
|
|
15911
15937
|
|
|
15912
|
-
function rerenderDeferredValue(value
|
|
15938
|
+
function rerenderDeferredValue(value) {
|
|
15913
15939
|
var _rerenderState = rerenderState(),
|
|
15914
15940
|
prevValue = _rerenderState[0],
|
|
15915
15941
|
setValue = _rerenderState[1];
|
|
15916
15942
|
|
|
15917
15943
|
updateEffect(function () {
|
|
15918
|
-
var
|
|
15919
|
-
ReactCurrentBatchConfig$1.
|
|
15944
|
+
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
15945
|
+
ReactCurrentBatchConfig$1.transition = 1;
|
|
15920
15946
|
|
|
15921
15947
|
try {
|
|
15922
15948
|
setValue(value);
|
|
15923
15949
|
} finally {
|
|
15924
|
-
ReactCurrentBatchConfig$1.
|
|
15950
|
+
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
15925
15951
|
}
|
|
15926
|
-
}, [value
|
|
15952
|
+
}, [value]);
|
|
15927
15953
|
return prevValue;
|
|
15928
15954
|
}
|
|
15929
15955
|
|
|
15930
|
-
function startTransition(setPending,
|
|
15956
|
+
function startTransition(setPending, callback) {
|
|
15931
15957
|
var priorityLevel = getCurrentPriorityLevel();
|
|
15932
15958
|
|
|
15933
15959
|
{
|
|
@@ -15935,43 +15961,46 @@
|
|
|
15935
15961
|
setPending(true);
|
|
15936
15962
|
});
|
|
15937
15963
|
runWithPriority$1(priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel, function () {
|
|
15938
|
-
var
|
|
15939
|
-
ReactCurrentBatchConfig$1.
|
|
15964
|
+
var prevTransition = ReactCurrentBatchConfig$1.transition;
|
|
15965
|
+
ReactCurrentBatchConfig$1.transition = 1;
|
|
15940
15966
|
|
|
15941
15967
|
try {
|
|
15942
15968
|
setPending(false);
|
|
15943
15969
|
callback();
|
|
15944
15970
|
} finally {
|
|
15945
|
-
ReactCurrentBatchConfig$1.
|
|
15971
|
+
ReactCurrentBatchConfig$1.transition = prevTransition;
|
|
15946
15972
|
}
|
|
15947
15973
|
});
|
|
15948
15974
|
}
|
|
15949
15975
|
}
|
|
15950
15976
|
|
|
15951
|
-
function mountTransition(
|
|
15977
|
+
function mountTransition() {
|
|
15952
15978
|
var _mountState2 = mountState(false),
|
|
15953
15979
|
isPending = _mountState2[0],
|
|
15954
|
-
setPending = _mountState2[1];
|
|
15980
|
+
setPending = _mountState2[1]; // The `start` method can be stored on a ref, since `setPending`
|
|
15981
|
+
// never changes.
|
|
15955
15982
|
|
|
15956
|
-
|
|
15983
|
+
|
|
15984
|
+
var start = startTransition.bind(null, setPending);
|
|
15985
|
+
mountRef(start);
|
|
15957
15986
|
return [start, isPending];
|
|
15958
15987
|
}
|
|
15959
15988
|
|
|
15960
|
-
function updateTransition(
|
|
15989
|
+
function updateTransition() {
|
|
15961
15990
|
var _updateState2 = updateState(),
|
|
15962
|
-
isPending = _updateState2[0]
|
|
15963
|
-
setPending = _updateState2[1];
|
|
15991
|
+
isPending = _updateState2[0];
|
|
15964
15992
|
|
|
15965
|
-
var
|
|
15993
|
+
var startRef = updateRef();
|
|
15994
|
+
var start = startRef.current;
|
|
15966
15995
|
return [start, isPending];
|
|
15967
15996
|
}
|
|
15968
15997
|
|
|
15969
|
-
function rerenderTransition(
|
|
15998
|
+
function rerenderTransition() {
|
|
15970
15999
|
var _rerenderState2 = rerenderState(),
|
|
15971
|
-
isPending = _rerenderState2[0]
|
|
15972
|
-
setPending = _rerenderState2[1];
|
|
16000
|
+
isPending = _rerenderState2[0];
|
|
15973
16001
|
|
|
15974
|
-
var
|
|
16002
|
+
var startRef = updateRef();
|
|
16003
|
+
var start = startRef.current;
|
|
15975
16004
|
return [start, isPending];
|
|
15976
16005
|
}
|
|
15977
16006
|
|
|
@@ -16028,7 +16057,7 @@
|
|
|
16028
16057
|
var setId = mountState(id)[1];
|
|
16029
16058
|
|
|
16030
16059
|
if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {
|
|
16031
|
-
currentlyRenderingFiber$1.
|
|
16060
|
+
currentlyRenderingFiber$1.flags |= Update | Passive;
|
|
16032
16061
|
pushEffect(HasEffect | Passive$1, function () {
|
|
16033
16062
|
setId(makeId());
|
|
16034
16063
|
}, undefined, null);
|
|
@@ -16061,8 +16090,7 @@
|
|
|
16061
16090
|
}
|
|
16062
16091
|
|
|
16063
16092
|
var eventTime = requestEventTime();
|
|
16064
|
-
var
|
|
16065
|
-
var lane = requestUpdateLane(fiber, suspenseConfig);
|
|
16093
|
+
var lane = requestUpdateLane(fiber);
|
|
16066
16094
|
var update = {
|
|
16067
16095
|
lane: lane,
|
|
16068
16096
|
action: action,
|
|
@@ -16257,15 +16285,15 @@
|
|
|
16257
16285
|
mountHookTypesDev();
|
|
16258
16286
|
return mountDebugValue();
|
|
16259
16287
|
},
|
|
16260
|
-
useDeferredValue: function (value
|
|
16288
|
+
useDeferredValue: function (value) {
|
|
16261
16289
|
currentHookNameInDev = 'useDeferredValue';
|
|
16262
16290
|
mountHookTypesDev();
|
|
16263
|
-
return mountDeferredValue(value
|
|
16291
|
+
return mountDeferredValue(value);
|
|
16264
16292
|
},
|
|
16265
|
-
useTransition: function (
|
|
16293
|
+
useTransition: function () {
|
|
16266
16294
|
currentHookNameInDev = 'useTransition';
|
|
16267
16295
|
mountHookTypesDev();
|
|
16268
|
-
return mountTransition(
|
|
16296
|
+
return mountTransition();
|
|
16269
16297
|
},
|
|
16270
16298
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16271
16299
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16354,15 +16382,15 @@
|
|
|
16354
16382
|
updateHookTypesDev();
|
|
16355
16383
|
return mountDebugValue();
|
|
16356
16384
|
},
|
|
16357
|
-
useDeferredValue: function (value
|
|
16385
|
+
useDeferredValue: function (value) {
|
|
16358
16386
|
currentHookNameInDev = 'useDeferredValue';
|
|
16359
16387
|
updateHookTypesDev();
|
|
16360
|
-
return mountDeferredValue(value
|
|
16388
|
+
return mountDeferredValue(value);
|
|
16361
16389
|
},
|
|
16362
|
-
useTransition: function (
|
|
16390
|
+
useTransition: function () {
|
|
16363
16391
|
currentHookNameInDev = 'useTransition';
|
|
16364
16392
|
updateHookTypesDev();
|
|
16365
|
-
return mountTransition(
|
|
16393
|
+
return mountTransition();
|
|
16366
16394
|
},
|
|
16367
16395
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16368
16396
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16451,15 +16479,15 @@
|
|
|
16451
16479
|
updateHookTypesDev();
|
|
16452
16480
|
return updateDebugValue();
|
|
16453
16481
|
},
|
|
16454
|
-
useDeferredValue: function (value
|
|
16482
|
+
useDeferredValue: function (value) {
|
|
16455
16483
|
currentHookNameInDev = 'useDeferredValue';
|
|
16456
16484
|
updateHookTypesDev();
|
|
16457
|
-
return updateDeferredValue(value
|
|
16485
|
+
return updateDeferredValue(value);
|
|
16458
16486
|
},
|
|
16459
|
-
useTransition: function (
|
|
16487
|
+
useTransition: function () {
|
|
16460
16488
|
currentHookNameInDev = 'useTransition';
|
|
16461
16489
|
updateHookTypesDev();
|
|
16462
|
-
return updateTransition(
|
|
16490
|
+
return updateTransition();
|
|
16463
16491
|
},
|
|
16464
16492
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16465
16493
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16548,15 +16576,15 @@
|
|
|
16548
16576
|
updateHookTypesDev();
|
|
16549
16577
|
return updateDebugValue();
|
|
16550
16578
|
},
|
|
16551
|
-
useDeferredValue: function (value
|
|
16579
|
+
useDeferredValue: function (value) {
|
|
16552
16580
|
currentHookNameInDev = 'useDeferredValue';
|
|
16553
16581
|
updateHookTypesDev();
|
|
16554
|
-
return rerenderDeferredValue(value
|
|
16582
|
+
return rerenderDeferredValue(value);
|
|
16555
16583
|
},
|
|
16556
|
-
useTransition: function (
|
|
16584
|
+
useTransition: function () {
|
|
16557
16585
|
currentHookNameInDev = 'useTransition';
|
|
16558
16586
|
updateHookTypesDev();
|
|
16559
|
-
return rerenderTransition(
|
|
16587
|
+
return rerenderTransition();
|
|
16560
16588
|
},
|
|
16561
16589
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16562
16590
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16656,17 +16684,17 @@
|
|
|
16656
16684
|
mountHookTypesDev();
|
|
16657
16685
|
return mountDebugValue();
|
|
16658
16686
|
},
|
|
16659
|
-
useDeferredValue: function (value
|
|
16687
|
+
useDeferredValue: function (value) {
|
|
16660
16688
|
currentHookNameInDev = 'useDeferredValue';
|
|
16661
16689
|
warnInvalidHookAccess();
|
|
16662
16690
|
mountHookTypesDev();
|
|
16663
|
-
return mountDeferredValue(value
|
|
16691
|
+
return mountDeferredValue(value);
|
|
16664
16692
|
},
|
|
16665
|
-
useTransition: function (
|
|
16693
|
+
useTransition: function () {
|
|
16666
16694
|
currentHookNameInDev = 'useTransition';
|
|
16667
16695
|
warnInvalidHookAccess();
|
|
16668
16696
|
mountHookTypesDev();
|
|
16669
|
-
return mountTransition(
|
|
16697
|
+
return mountTransition();
|
|
16670
16698
|
},
|
|
16671
16699
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16672
16700
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16768,17 +16796,17 @@
|
|
|
16768
16796
|
updateHookTypesDev();
|
|
16769
16797
|
return updateDebugValue();
|
|
16770
16798
|
},
|
|
16771
|
-
useDeferredValue: function (value
|
|
16799
|
+
useDeferredValue: function (value) {
|
|
16772
16800
|
currentHookNameInDev = 'useDeferredValue';
|
|
16773
16801
|
warnInvalidHookAccess();
|
|
16774
16802
|
updateHookTypesDev();
|
|
16775
|
-
return updateDeferredValue(value
|
|
16803
|
+
return updateDeferredValue(value);
|
|
16776
16804
|
},
|
|
16777
|
-
useTransition: function (
|
|
16805
|
+
useTransition: function () {
|
|
16778
16806
|
currentHookNameInDev = 'useTransition';
|
|
16779
16807
|
warnInvalidHookAccess();
|
|
16780
16808
|
updateHookTypesDev();
|
|
16781
|
-
return updateTransition(
|
|
16809
|
+
return updateTransition();
|
|
16782
16810
|
},
|
|
16783
16811
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16784
16812
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -16880,17 +16908,17 @@
|
|
|
16880
16908
|
updateHookTypesDev();
|
|
16881
16909
|
return updateDebugValue();
|
|
16882
16910
|
},
|
|
16883
|
-
useDeferredValue: function (value
|
|
16911
|
+
useDeferredValue: function (value) {
|
|
16884
16912
|
currentHookNameInDev = 'useDeferredValue';
|
|
16885
16913
|
warnInvalidHookAccess();
|
|
16886
16914
|
updateHookTypesDev();
|
|
16887
|
-
return rerenderDeferredValue(value
|
|
16915
|
+
return rerenderDeferredValue(value);
|
|
16888
16916
|
},
|
|
16889
|
-
useTransition: function (
|
|
16917
|
+
useTransition: function () {
|
|
16890
16918
|
currentHookNameInDev = 'useTransition';
|
|
16891
16919
|
warnInvalidHookAccess();
|
|
16892
16920
|
updateHookTypesDev();
|
|
16893
|
-
return rerenderTransition(
|
|
16921
|
+
return rerenderTransition();
|
|
16894
16922
|
},
|
|
16895
16923
|
useMutableSource: function (source, getSnapshot, subscribe) {
|
|
16896
16924
|
currentHookNameInDev = 'useMutableSource';
|
|
@@ -17064,7 +17092,7 @@
|
|
|
17064
17092
|
} // React DevTools reads this flag.
|
|
17065
17093
|
|
|
17066
17094
|
|
|
17067
|
-
workInProgress.
|
|
17095
|
+
workInProgress.flags |= PerformedWork;
|
|
17068
17096
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
17069
17097
|
return workInProgress.child;
|
|
17070
17098
|
}
|
|
@@ -17140,7 +17168,7 @@
|
|
|
17140
17168
|
} // React DevTools reads this flag.
|
|
17141
17169
|
|
|
17142
17170
|
|
|
17143
|
-
workInProgress.
|
|
17171
|
+
workInProgress.flags |= PerformedWork;
|
|
17144
17172
|
var newChild = createWorkInProgress(currentChild, nextProps);
|
|
17145
17173
|
newChild.ref = workInProgress.ref;
|
|
17146
17174
|
newChild.return = workInProgress;
|
|
@@ -17206,7 +17234,7 @@
|
|
|
17206
17234
|
// this is no longer necessary.
|
|
17207
17235
|
workInProgress.lanes = current.lanes;
|
|
17208
17236
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
17209
|
-
} else if ((current.
|
|
17237
|
+
} else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
17210
17238
|
// This is a special case that only exists for legacy mode.
|
|
17211
17239
|
// See https://github.com/facebook/react/pull/19216.
|
|
17212
17240
|
didReceiveUpdate = true;
|
|
@@ -17305,7 +17333,7 @@
|
|
|
17305
17333
|
|
|
17306
17334
|
function updateProfiler(current, workInProgress, renderLanes) {
|
|
17307
17335
|
{
|
|
17308
|
-
workInProgress.
|
|
17336
|
+
workInProgress.flags |= Update; // Reset effect durations for the next eventual effect phase.
|
|
17309
17337
|
// These are reset during render to allow the DevTools commit hook a chance to read them,
|
|
17310
17338
|
|
|
17311
17339
|
var stateNode = workInProgress.stateNode;
|
|
@@ -17324,7 +17352,7 @@
|
|
|
17324
17352
|
|
|
17325
17353
|
if (current === null && ref !== null || current !== null && current.ref !== ref) {
|
|
17326
17354
|
// Schedule a Ref effect
|
|
17327
|
-
workInProgress.
|
|
17355
|
+
workInProgress.flags |= Ref;
|
|
17328
17356
|
}
|
|
17329
17357
|
}
|
|
17330
17358
|
|
|
@@ -17376,7 +17404,7 @@
|
|
|
17376
17404
|
} // React DevTools reads this flag.
|
|
17377
17405
|
|
|
17378
17406
|
|
|
17379
|
-
workInProgress.
|
|
17407
|
+
workInProgress.flags |= PerformedWork;
|
|
17380
17408
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
17381
17409
|
return workInProgress.child;
|
|
17382
17410
|
}
|
|
@@ -17420,7 +17448,7 @@
|
|
|
17420
17448
|
current.alternate = null;
|
|
17421
17449
|
workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
|
|
17422
17450
|
|
|
17423
|
-
workInProgress.
|
|
17451
|
+
workInProgress.flags |= Placement;
|
|
17424
17452
|
} // In the initial pass we might need to construct the instance.
|
|
17425
17453
|
|
|
17426
17454
|
|
|
@@ -17454,7 +17482,7 @@
|
|
|
17454
17482
|
function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {
|
|
17455
17483
|
// Refs should update even if shouldComponentUpdate returns false
|
|
17456
17484
|
markRef(current, workInProgress);
|
|
17457
|
-
var didCaptureError = (workInProgress.
|
|
17485
|
+
var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;
|
|
17458
17486
|
|
|
17459
17487
|
if (!shouldUpdate && !didCaptureError) {
|
|
17460
17488
|
// Context providers should defer to sCU for rendering
|
|
@@ -17501,7 +17529,7 @@
|
|
|
17501
17529
|
} // React DevTools reads this flag.
|
|
17502
17530
|
|
|
17503
17531
|
|
|
17504
|
-
workInProgress.
|
|
17532
|
+
workInProgress.flags |= PerformedWork;
|
|
17505
17533
|
|
|
17506
17534
|
if (current !== null && didCaptureError) {
|
|
17507
17535
|
// If we're recovering from an error, reconcile without reusing any of
|
|
@@ -17592,7 +17620,7 @@
|
|
|
17592
17620
|
// Conceptually this is similar to Placement in that a new subtree is
|
|
17593
17621
|
// inserted into the React tree here. It just happens to not need DOM
|
|
17594
17622
|
// mutations because it already exists.
|
|
17595
|
-
node.
|
|
17623
|
+
node.flags = node.flags & ~Placement | Hydrating;
|
|
17596
17624
|
node = node.sibling;
|
|
17597
17625
|
}
|
|
17598
17626
|
} else {
|
|
@@ -17627,7 +17655,7 @@
|
|
|
17627
17655
|
} else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
|
|
17628
17656
|
// If we're switching from a direct text child to a normal child, or to
|
|
17629
17657
|
// empty, we need to schedule the text content to be reset.
|
|
17630
|
-
workInProgress.
|
|
17658
|
+
workInProgress.flags |= ContentReset;
|
|
17631
17659
|
}
|
|
17632
17660
|
|
|
17633
17661
|
markRef(current, workInProgress);
|
|
@@ -17654,7 +17682,7 @@
|
|
|
17654
17682
|
_current.alternate = null;
|
|
17655
17683
|
workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
|
|
17656
17684
|
|
|
17657
|
-
workInProgress.
|
|
17685
|
+
workInProgress.flags |= Placement;
|
|
17658
17686
|
}
|
|
17659
17687
|
|
|
17660
17688
|
var props = workInProgress.pendingProps;
|
|
@@ -17746,7 +17774,7 @@
|
|
|
17746
17774
|
_current.alternate = null;
|
|
17747
17775
|
workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
|
|
17748
17776
|
|
|
17749
|
-
workInProgress.
|
|
17777
|
+
workInProgress.flags |= Placement;
|
|
17750
17778
|
} // Promote the fiber to a class and try rendering again.
|
|
17751
17779
|
|
|
17752
17780
|
|
|
@@ -17779,7 +17807,7 @@
|
|
|
17779
17807
|
_current.alternate = null;
|
|
17780
17808
|
workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
|
|
17781
17809
|
|
|
17782
|
-
workInProgress.
|
|
17810
|
+
workInProgress.flags |= Placement;
|
|
17783
17811
|
}
|
|
17784
17812
|
|
|
17785
17813
|
var props = workInProgress.pendingProps;
|
|
@@ -17815,7 +17843,7 @@
|
|
|
17815
17843
|
} // React DevTools reads this flag.
|
|
17816
17844
|
|
|
17817
17845
|
|
|
17818
|
-
workInProgress.
|
|
17846
|
+
workInProgress.flags |= PerformedWork;
|
|
17819
17847
|
|
|
17820
17848
|
{
|
|
17821
17849
|
// Support for module components is deprecated and is removed behind a flag.
|
|
@@ -17966,7 +17994,8 @@
|
|
|
17966
17994
|
return {
|
|
17967
17995
|
baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes)
|
|
17968
17996
|
};
|
|
17969
|
-
}
|
|
17997
|
+
} // TODO: Probably should inline this back
|
|
17998
|
+
|
|
17970
17999
|
|
|
17971
18000
|
function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {
|
|
17972
18001
|
// If we're already showing a fallback, there are cases where we need to
|
|
@@ -17998,19 +18027,19 @@
|
|
|
17998
18027
|
|
|
17999
18028
|
{
|
|
18000
18029
|
if (shouldSuspend(workInProgress)) {
|
|
18001
|
-
workInProgress.
|
|
18030
|
+
workInProgress.flags |= DidCapture;
|
|
18002
18031
|
}
|
|
18003
18032
|
}
|
|
18004
18033
|
|
|
18005
18034
|
var suspenseContext = suspenseStackCursor.current;
|
|
18006
18035
|
var showFallback = false;
|
|
18007
|
-
var didSuspend = (workInProgress.
|
|
18036
|
+
var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;
|
|
18008
18037
|
|
|
18009
18038
|
if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {
|
|
18010
18039
|
// Something in this boundary's subtree already suspended. Switch to
|
|
18011
18040
|
// rendering the fallback children.
|
|
18012
18041
|
showFallback = true;
|
|
18013
|
-
workInProgress.
|
|
18042
|
+
workInProgress.flags &= ~DidCapture;
|
|
18014
18043
|
} else {
|
|
18015
18044
|
// Attempting the main content
|
|
18016
18045
|
if (current === null || current.memoizedState !== null) {
|
|
@@ -18057,17 +18086,41 @@
|
|
|
18057
18086
|
tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
|
|
18058
18087
|
}
|
|
18059
18088
|
|
|
18089
|
+
var nextPrimaryChildren = nextProps.children;
|
|
18090
|
+
var nextFallbackChildren = nextProps.fallback;
|
|
18091
|
+
|
|
18060
18092
|
if (showFallback) {
|
|
18061
|
-
var nextPrimaryChildren = nextProps.children;
|
|
18062
|
-
var nextFallbackChildren = nextProps.fallback;
|
|
18063
18093
|
var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);
|
|
18064
18094
|
var primaryChildFragment = workInProgress.child;
|
|
18065
18095
|
primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
|
|
18066
18096
|
workInProgress.memoizedState = SUSPENDED_MARKER;
|
|
18067
18097
|
return fallbackFragment;
|
|
18098
|
+
} else if (typeof nextProps.unstable_expectedLoadTime === 'number') {
|
|
18099
|
+
// This is a CPU-bound tree. Skip this tree and show a placeholder to
|
|
18100
|
+
// unblock the surrounding content. Then immediately retry after the
|
|
18101
|
+
// initial commit.
|
|
18102
|
+
var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);
|
|
18103
|
+
|
|
18104
|
+
var _primaryChildFragment = workInProgress.child;
|
|
18105
|
+
_primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);
|
|
18106
|
+
workInProgress.memoizedState = SUSPENDED_MARKER; // Since nothing actually suspended, there will nothing to ping this to
|
|
18107
|
+
// get it started back up to attempt the next item. While in terms of
|
|
18108
|
+
// priority this work has the same priority as this current render, it's
|
|
18109
|
+
// not part of the same transition once the transition has committed. If
|
|
18110
|
+
// it's sync, we still want to yield so that it can be painted.
|
|
18111
|
+
// Conceptually, this is really the same as pinging. We can use any
|
|
18112
|
+
// RetryLane even if it's the one currently rendering since we're leaving
|
|
18113
|
+
// it behind on this node.
|
|
18114
|
+
|
|
18115
|
+
workInProgress.lanes = SomeRetryLane;
|
|
18116
|
+
|
|
18117
|
+
{
|
|
18118
|
+
markSpawnedWork(SomeRetryLane);
|
|
18119
|
+
}
|
|
18120
|
+
|
|
18121
|
+
return _fallbackFragment;
|
|
18068
18122
|
} else {
|
|
18069
|
-
|
|
18070
|
-
return mountSuspensePrimaryChildren(workInProgress, _nextPrimaryChildren, renderLanes);
|
|
18123
|
+
return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren, renderLanes);
|
|
18071
18124
|
}
|
|
18072
18125
|
} else {
|
|
18073
18126
|
// This is an update.
|
|
@@ -18079,37 +18132,37 @@
|
|
|
18079
18132
|
|
|
18080
18133
|
if (showFallback) {
|
|
18081
18134
|
var _nextFallbackChildren2 = nextProps.fallback;
|
|
18082
|
-
var
|
|
18135
|
+
var _nextPrimaryChildren2 = nextProps.children;
|
|
18083
18136
|
|
|
18084
|
-
var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress,
|
|
18137
|
+
var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes);
|
|
18085
18138
|
|
|
18086
|
-
var
|
|
18139
|
+
var _primaryChildFragment3 = workInProgress.child;
|
|
18087
18140
|
var prevOffscreenState = current.child.memoizedState;
|
|
18088
|
-
|
|
18089
|
-
|
|
18141
|
+
_primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);
|
|
18142
|
+
_primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);
|
|
18090
18143
|
workInProgress.memoizedState = SUSPENDED_MARKER;
|
|
18091
18144
|
return _fallbackChildFragment;
|
|
18092
18145
|
} else {
|
|
18093
|
-
var
|
|
18146
|
+
var _nextPrimaryChildren3 = nextProps.children;
|
|
18094
18147
|
|
|
18095
|
-
var
|
|
18148
|
+
var _primaryChildFragment4 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren3, renderLanes);
|
|
18096
18149
|
|
|
18097
18150
|
workInProgress.memoizedState = null;
|
|
18098
|
-
return
|
|
18151
|
+
return _primaryChildFragment4;
|
|
18099
18152
|
}
|
|
18100
18153
|
} else {
|
|
18101
18154
|
// The current tree is not already showing a fallback.
|
|
18102
18155
|
if (showFallback) {
|
|
18103
18156
|
// Timed out.
|
|
18104
18157
|
var _nextFallbackChildren3 = nextProps.fallback;
|
|
18105
|
-
var
|
|
18158
|
+
var _nextPrimaryChildren4 = nextProps.children;
|
|
18106
18159
|
|
|
18107
|
-
var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress,
|
|
18160
|
+
var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes);
|
|
18108
18161
|
|
|
18109
|
-
var
|
|
18162
|
+
var _primaryChildFragment5 = workInProgress.child;
|
|
18110
18163
|
var _prevOffscreenState = current.child.memoizedState;
|
|
18111
|
-
|
|
18112
|
-
|
|
18164
|
+
_primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes);
|
|
18165
|
+
_primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); // Skip the primary children, and continue working on the
|
|
18113
18166
|
// fallback children.
|
|
18114
18167
|
|
|
18115
18168
|
workInProgress.memoizedState = SUSPENDED_MARKER;
|
|
@@ -18117,12 +18170,12 @@
|
|
|
18117
18170
|
} else {
|
|
18118
18171
|
// Still haven't timed out. Continue rendering the children, like we
|
|
18119
18172
|
// normally do.
|
|
18120
|
-
var
|
|
18173
|
+
var _nextPrimaryChildren5 = nextProps.children;
|
|
18121
18174
|
|
|
18122
|
-
var
|
|
18175
|
+
var _primaryChildFragment6 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren5, renderLanes);
|
|
18123
18176
|
|
|
18124
18177
|
workInProgress.memoizedState = null;
|
|
18125
|
-
return
|
|
18178
|
+
return _primaryChildFragment6;
|
|
18126
18179
|
}
|
|
18127
18180
|
}
|
|
18128
18181
|
}
|
|
@@ -18205,7 +18258,7 @@
|
|
|
18205
18258
|
if (currentFallbackChildFragment !== null) {
|
|
18206
18259
|
// Delete the fallback child fragment
|
|
18207
18260
|
currentFallbackChildFragment.nextEffect = null;
|
|
18208
|
-
currentFallbackChildFragment.
|
|
18261
|
+
currentFallbackChildFragment.flags = Deletion;
|
|
18209
18262
|
workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment;
|
|
18210
18263
|
}
|
|
18211
18264
|
|
|
@@ -18276,7 +18329,7 @@
|
|
|
18276
18329
|
fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already
|
|
18277
18330
|
// mounted but this is a new fiber.
|
|
18278
18331
|
|
|
18279
|
-
fallbackChildFragment.
|
|
18332
|
+
fallbackChildFragment.flags |= Placement;
|
|
18280
18333
|
}
|
|
18281
18334
|
|
|
18282
18335
|
fallbackChildFragment.return = workInProgress;
|
|
@@ -18514,9 +18567,9 @@
|
|
|
18514
18567
|
|
|
18515
18568
|
if (shouldForceFallback) {
|
|
18516
18569
|
suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
|
|
18517
|
-
workInProgress.
|
|
18570
|
+
workInProgress.flags |= DidCapture;
|
|
18518
18571
|
} else {
|
|
18519
|
-
var didSuspendBefore = current !== null && (current.
|
|
18572
|
+
var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;
|
|
18520
18573
|
|
|
18521
18574
|
if (didSuspendBefore) {
|
|
18522
18575
|
// If we previously forced a fallback, we need to schedule work
|
|
@@ -18726,7 +18779,7 @@
|
|
|
18726
18779
|
} // React DevTools reads this flag.
|
|
18727
18780
|
|
|
18728
18781
|
|
|
18729
|
-
workInProgress.
|
|
18782
|
+
workInProgress.flags |= PerformedWork;
|
|
18730
18783
|
reconcileChildren(current, workInProgress, newChildren, renderLanes);
|
|
18731
18784
|
return workInProgress.child;
|
|
18732
18785
|
}
|
|
@@ -18811,8 +18864,8 @@
|
|
|
18811
18864
|
}
|
|
18812
18865
|
|
|
18813
18866
|
current.nextEffect = null;
|
|
18814
|
-
current.
|
|
18815
|
-
newWorkInProgress.
|
|
18867
|
+
current.flags = Deletion;
|
|
18868
|
+
newWorkInProgress.flags |= Placement; // Restart work from the new fiber.
|
|
18816
18869
|
|
|
18817
18870
|
return newWorkInProgress;
|
|
18818
18871
|
}
|
|
@@ -18880,7 +18933,7 @@
|
|
|
18880
18933
|
var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);
|
|
18881
18934
|
|
|
18882
18935
|
if (hasChildWork) {
|
|
18883
|
-
workInProgress.
|
|
18936
|
+
workInProgress.flags |= Update;
|
|
18884
18937
|
} // Reset effect durations for the next eventual effect phase.
|
|
18885
18938
|
// These are reset during render to allow the DevTools commit hook a chance to read them,
|
|
18886
18939
|
|
|
@@ -18934,7 +18987,7 @@
|
|
|
18934
18987
|
|
|
18935
18988
|
case SuspenseListComponent:
|
|
18936
18989
|
{
|
|
18937
|
-
var didSuspendBefore = (current.
|
|
18990
|
+
var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;
|
|
18938
18991
|
|
|
18939
18992
|
var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);
|
|
18940
18993
|
|
|
@@ -18951,7 +19004,7 @@
|
|
|
18951
19004
|
// as before. We can fast bail out.
|
|
18952
19005
|
|
|
18953
19006
|
|
|
18954
|
-
workInProgress.
|
|
19007
|
+
workInProgress.flags |= DidCapture;
|
|
18955
19008
|
} // If nothing suspended before and we're rendering the same children,
|
|
18956
19009
|
// then the tail doesn't matter. Anything new that suspends will work
|
|
18957
19010
|
// in the "together" mode, so we can continue from the state we had.
|
|
@@ -18997,7 +19050,7 @@
|
|
|
18997
19050
|
|
|
18998
19051
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
18999
19052
|
} else {
|
|
19000
|
-
if ((current.
|
|
19053
|
+
if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
|
|
19001
19054
|
// This is a special case that only exists for legacy mode.
|
|
19002
19055
|
// See https://github.com/facebook/react/pull/19216.
|
|
19003
19056
|
didReceiveUpdate = true;
|
|
@@ -19171,11 +19224,11 @@
|
|
|
19171
19224
|
function markUpdate(workInProgress) {
|
|
19172
19225
|
// Tag the fiber with an update effect. This turns a Placement into
|
|
19173
19226
|
// a PlacementAndUpdate.
|
|
19174
|
-
workInProgress.
|
|
19227
|
+
workInProgress.flags |= Update;
|
|
19175
19228
|
}
|
|
19176
19229
|
|
|
19177
19230
|
function markRef$1(workInProgress) {
|
|
19178
|
-
workInProgress.
|
|
19231
|
+
workInProgress.flags |= Ref;
|
|
19179
19232
|
}
|
|
19180
19233
|
|
|
19181
19234
|
var appendAllChildren;
|
|
@@ -19390,7 +19443,7 @@
|
|
|
19390
19443
|
// This handles the case of React rendering into a container with previous children.
|
|
19391
19444
|
// It's also safe to do for updates too, because current.child would only be null
|
|
19392
19445
|
// if the previous render was null (so the the container would already be empty).
|
|
19393
|
-
workInProgress.
|
|
19446
|
+
workInProgress.flags |= Snapshot;
|
|
19394
19447
|
}
|
|
19395
19448
|
}
|
|
19396
19449
|
|
|
@@ -19500,7 +19553,7 @@
|
|
|
19500
19553
|
popSuspenseContext(workInProgress);
|
|
19501
19554
|
var nextState = workInProgress.memoizedState;
|
|
19502
19555
|
|
|
19503
|
-
if ((workInProgress.
|
|
19556
|
+
if ((workInProgress.flags & DidCapture) !== NoFlags) {
|
|
19504
19557
|
// Something suspended. Re-render with the fallback children.
|
|
19505
19558
|
workInProgress.lanes = renderLanes; // Do not reset the effect list.
|
|
19506
19559
|
|
|
@@ -19559,7 +19612,7 @@
|
|
|
19559
19612
|
// primary children. In mutation mode, we also need the flag to
|
|
19560
19613
|
// *unhide* children that were previously hidden, so check if this
|
|
19561
19614
|
// is currently timed out, too.
|
|
19562
|
-
workInProgress.
|
|
19615
|
+
workInProgress.flags |= Update;
|
|
19563
19616
|
}
|
|
19564
19617
|
}
|
|
19565
19618
|
|
|
@@ -19605,7 +19658,7 @@
|
|
|
19605
19658
|
return null;
|
|
19606
19659
|
}
|
|
19607
19660
|
|
|
19608
|
-
var didSuspendAlready = (workInProgress.
|
|
19661
|
+
var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;
|
|
19609
19662
|
var renderedTail = renderState.rendering;
|
|
19610
19663
|
|
|
19611
19664
|
if (renderedTail === null) {
|
|
@@ -19620,7 +19673,7 @@
|
|
|
19620
19673
|
// something in the previous committed pass suspended. Otherwise,
|
|
19621
19674
|
// there's no chance so we can skip the expensive call to
|
|
19622
19675
|
// findFirstSuspended.
|
|
19623
|
-
var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.
|
|
19676
|
+
var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);
|
|
19624
19677
|
|
|
19625
19678
|
if (!cannotBeSuspended) {
|
|
19626
19679
|
var row = workInProgress.child;
|
|
@@ -19630,7 +19683,7 @@
|
|
|
19630
19683
|
|
|
19631
19684
|
if (suspended !== null) {
|
|
19632
19685
|
didSuspendAlready = true;
|
|
19633
|
-
workInProgress.
|
|
19686
|
+
workInProgress.flags |= DidCapture;
|
|
19634
19687
|
cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
|
|
19635
19688
|
// part of the second pass. In that case nothing will subscribe to
|
|
19636
19689
|
// its thennables. Instead, we'll transfer its thennables to the
|
|
@@ -19648,7 +19701,7 @@
|
|
|
19648
19701
|
|
|
19649
19702
|
if (newThennables !== null) {
|
|
19650
19703
|
workInProgress.updateQueue = newThennables;
|
|
19651
|
-
workInProgress.
|
|
19704
|
+
workInProgress.flags |= Update;
|
|
19652
19705
|
} // Rerender the whole list, but this time, we'll force fallbacks
|
|
19653
19706
|
// to stay in place.
|
|
19654
19707
|
// Reset the effect list before doing the second pass since that's now invalid.
|
|
@@ -19675,7 +19728,7 @@
|
|
|
19675
19728
|
// We have already passed our CPU deadline but we still have rows
|
|
19676
19729
|
// left in the tail. We'll just give up further attempts to render
|
|
19677
19730
|
// the main content and only render fallbacks.
|
|
19678
|
-
workInProgress.
|
|
19731
|
+
workInProgress.flags |= DidCapture;
|
|
19679
19732
|
didSuspendAlready = true;
|
|
19680
19733
|
cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
|
|
19681
19734
|
// to get it started back up to attempt the next item. While in terms
|
|
@@ -19702,7 +19755,7 @@
|
|
|
19702
19755
|
var _suspended = findFirstSuspended(renderedTail);
|
|
19703
19756
|
|
|
19704
19757
|
if (_suspended !== null) {
|
|
19705
|
-
workInProgress.
|
|
19758
|
+
workInProgress.flags |= DidCapture;
|
|
19706
19759
|
didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
|
|
19707
19760
|
// get lost if this row ends up dropped during a second pass.
|
|
19708
19761
|
|
|
@@ -19710,7 +19763,7 @@
|
|
|
19710
19763
|
|
|
19711
19764
|
if (_newThennables !== null) {
|
|
19712
19765
|
workInProgress.updateQueue = _newThennables;
|
|
19713
|
-
workInProgress.
|
|
19766
|
+
workInProgress.flags |= Update;
|
|
19714
19767
|
}
|
|
19715
19768
|
|
|
19716
19769
|
cutOffTailIfNeeded(renderState, true); // This might have been modified.
|
|
@@ -19736,7 +19789,7 @@
|
|
|
19736
19789
|
// We have now passed our CPU deadline and we'll just give up further
|
|
19737
19790
|
// attempts to render the main content and only render fallbacks.
|
|
19738
19791
|
// The assumption is that this is usually faster.
|
|
19739
|
-
workInProgress.
|
|
19792
|
+
workInProgress.flags |= DidCapture;
|
|
19740
19793
|
didSuspendAlready = true;
|
|
19741
19794
|
cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
|
|
19742
19795
|
// to get it started back up to attempt the next item. While in terms
|
|
@@ -19832,7 +19885,7 @@
|
|
|
19832
19885
|
var nextIsHidden = _nextState !== null;
|
|
19833
19886
|
|
|
19834
19887
|
if (prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding') {
|
|
19835
|
-
workInProgress.
|
|
19888
|
+
workInProgress.flags |= Update;
|
|
19836
19889
|
}
|
|
19837
19890
|
}
|
|
19838
19891
|
|
|
@@ -19857,10 +19910,10 @@
|
|
|
19857
19910
|
popContext(workInProgress);
|
|
19858
19911
|
}
|
|
19859
19912
|
|
|
19860
|
-
var
|
|
19913
|
+
var flags = workInProgress.flags;
|
|
19861
19914
|
|
|
19862
|
-
if (
|
|
19863
|
-
workInProgress.
|
|
19915
|
+
if (flags & ShouldCapture) {
|
|
19916
|
+
workInProgress.flags = flags & ~ShouldCapture | DidCapture;
|
|
19864
19917
|
|
|
19865
19918
|
if ( (workInProgress.mode & ProfileMode) !== NoMode) {
|
|
19866
19919
|
transferActualDuration(workInProgress);
|
|
@@ -19877,15 +19930,15 @@
|
|
|
19877
19930
|
popHostContainer(workInProgress);
|
|
19878
19931
|
popTopLevelContextObject(workInProgress);
|
|
19879
19932
|
resetWorkInProgressVersions();
|
|
19880
|
-
var
|
|
19933
|
+
var _flags = workInProgress.flags;
|
|
19881
19934
|
|
|
19882
|
-
if (!((
|
|
19935
|
+
if (!((_flags & DidCapture) === NoFlags)) {
|
|
19883
19936
|
{
|
|
19884
19937
|
throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
|
|
19885
19938
|
}
|
|
19886
19939
|
}
|
|
19887
19940
|
|
|
19888
|
-
workInProgress.
|
|
19941
|
+
workInProgress.flags = _flags & ~ShouldCapture | DidCapture;
|
|
19889
19942
|
return workInProgress;
|
|
19890
19943
|
}
|
|
19891
19944
|
|
|
@@ -19900,10 +19953,10 @@
|
|
|
19900
19953
|
{
|
|
19901
19954
|
popSuspenseContext(workInProgress);
|
|
19902
19955
|
|
|
19903
|
-
var
|
|
19956
|
+
var _flags2 = workInProgress.flags;
|
|
19904
19957
|
|
|
19905
|
-
if (
|
|
19906
|
-
workInProgress.
|
|
19958
|
+
if (_flags2 & ShouldCapture) {
|
|
19959
|
+
workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
|
|
19907
19960
|
|
|
19908
19961
|
if ( (workInProgress.mode & ProfileMode) !== NoMode) {
|
|
19909
19962
|
transferActualDuration(workInProgress);
|
|
@@ -20187,7 +20240,7 @@
|
|
|
20187
20240
|
|
|
20188
20241
|
function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {
|
|
20189
20242
|
// The source fiber did not complete.
|
|
20190
|
-
sourceFiber.
|
|
20243
|
+
sourceFiber.flags |= Incomplete; // Its effect list is no longer valid.
|
|
20191
20244
|
|
|
20192
20245
|
sourceFiber.firstEffect = sourceFiber.lastEffect = null;
|
|
20193
20246
|
|
|
@@ -20238,12 +20291,12 @@
|
|
|
20238
20291
|
|
|
20239
20292
|
|
|
20240
20293
|
if ((_workInProgress.mode & BlockingMode) === NoMode) {
|
|
20241
|
-
_workInProgress.
|
|
20242
|
-
sourceFiber.
|
|
20294
|
+
_workInProgress.flags |= DidCapture;
|
|
20295
|
+
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
20243
20296
|
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
20244
20297
|
// all lifecycle effect tags.
|
|
20245
20298
|
|
|
20246
|
-
sourceFiber.
|
|
20299
|
+
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
20247
20300
|
|
|
20248
20301
|
if (sourceFiber.tag === ClassComponent) {
|
|
20249
20302
|
var currentSourceFiber = sourceFiber.alternate;
|
|
@@ -20293,8 +20346,8 @@
|
|
|
20293
20346
|
// that we can show the initial loading state as quickly as possible.
|
|
20294
20347
|
//
|
|
20295
20348
|
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
20296
|
-
// a fallback, then we should always suspend/restart.
|
|
20297
|
-
// this case. If none is defined, JND is used instead.
|
|
20349
|
+
// a fallback, then we should always suspend/restart. Transitions apply
|
|
20350
|
+
// to this case. If none is defined, JND is used instead.
|
|
20298
20351
|
//
|
|
20299
20352
|
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
20300
20353
|
// another level, but there's still an inner boundary that would show a fallback,
|
|
@@ -20311,7 +20364,7 @@
|
|
|
20311
20364
|
|
|
20312
20365
|
|
|
20313
20366
|
attachPingListener(root, wakeable, rootRenderLanes);
|
|
20314
|
-
_workInProgress.
|
|
20367
|
+
_workInProgress.flags |= ShouldCapture;
|
|
20315
20368
|
_workInProgress.lanes = rootRenderLanes;
|
|
20316
20369
|
return;
|
|
20317
20370
|
} // This boundary already captured during this render. Continue to the next
|
|
@@ -20338,7 +20391,7 @@
|
|
|
20338
20391
|
case HostRoot:
|
|
20339
20392
|
{
|
|
20340
20393
|
var _errorInfo = value;
|
|
20341
|
-
workInProgress.
|
|
20394
|
+
workInProgress.flags |= ShouldCapture;
|
|
20342
20395
|
var lane = pickArbitraryLane(rootRenderLanes);
|
|
20343
20396
|
workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);
|
|
20344
20397
|
|
|
@@ -20354,8 +20407,8 @@
|
|
|
20354
20407
|
var ctor = workInProgress.type;
|
|
20355
20408
|
var instance = workInProgress.stateNode;
|
|
20356
20409
|
|
|
20357
|
-
if ((workInProgress.
|
|
20358
|
-
workInProgress.
|
|
20410
|
+
if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
|
|
20411
|
+
workInProgress.flags |= ShouldCapture;
|
|
20359
20412
|
|
|
20360
20413
|
var _lane = pickArbitraryLane(rootRenderLanes);
|
|
20361
20414
|
|
|
@@ -20392,18 +20445,18 @@
|
|
|
20392
20445
|
}; // Capture errors so they don't interrupt unmounting.
|
|
20393
20446
|
|
|
20394
20447
|
|
|
20395
|
-
function safelyCallComponentWillUnmount(current, instance
|
|
20448
|
+
function safelyCallComponentWillUnmount(current, instance) {
|
|
20396
20449
|
{
|
|
20397
20450
|
invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);
|
|
20398
20451
|
|
|
20399
20452
|
if (hasCaughtError()) {
|
|
20400
20453
|
var unmountError = clearCaughtError();
|
|
20401
|
-
captureCommitPhaseError(current,
|
|
20454
|
+
captureCommitPhaseError(current, unmountError);
|
|
20402
20455
|
}
|
|
20403
20456
|
}
|
|
20404
20457
|
}
|
|
20405
20458
|
|
|
20406
|
-
function safelyDetachRef(current
|
|
20459
|
+
function safelyDetachRef(current) {
|
|
20407
20460
|
var ref = current.ref;
|
|
20408
20461
|
|
|
20409
20462
|
if (ref !== null) {
|
|
@@ -20413,7 +20466,7 @@
|
|
|
20413
20466
|
|
|
20414
20467
|
if (hasCaughtError()) {
|
|
20415
20468
|
var refError = clearCaughtError();
|
|
20416
|
-
captureCommitPhaseError(current,
|
|
20469
|
+
captureCommitPhaseError(current, refError);
|
|
20417
20470
|
}
|
|
20418
20471
|
}
|
|
20419
20472
|
} else {
|
|
@@ -20422,13 +20475,13 @@
|
|
|
20422
20475
|
}
|
|
20423
20476
|
}
|
|
20424
20477
|
|
|
20425
|
-
function safelyCallDestroy(current,
|
|
20478
|
+
function safelyCallDestroy(current, destroy) {
|
|
20426
20479
|
{
|
|
20427
20480
|
invokeGuardedCallback(null, destroy, null);
|
|
20428
20481
|
|
|
20429
20482
|
if (hasCaughtError()) {
|
|
20430
20483
|
var error = clearCaughtError();
|
|
20431
|
-
captureCommitPhaseError(current,
|
|
20484
|
+
captureCommitPhaseError(current, error);
|
|
20432
20485
|
}
|
|
20433
20486
|
}
|
|
20434
20487
|
}
|
|
@@ -20445,7 +20498,7 @@
|
|
|
20445
20498
|
|
|
20446
20499
|
case ClassComponent:
|
|
20447
20500
|
{
|
|
20448
|
-
if (finishedWork.
|
|
20501
|
+
if (finishedWork.flags & Snapshot) {
|
|
20449
20502
|
if (current !== null) {
|
|
20450
20503
|
var prevProps = current.memoizedProps;
|
|
20451
20504
|
var prevState = current.memoizedState;
|
|
@@ -20487,7 +20540,7 @@
|
|
|
20487
20540
|
case HostRoot:
|
|
20488
20541
|
{
|
|
20489
20542
|
{
|
|
20490
|
-
if (finishedWork.
|
|
20543
|
+
if (finishedWork.flags & Snapshot) {
|
|
20491
20544
|
var root = finishedWork.stateNode;
|
|
20492
20545
|
clearContainer(root.containerInfo);
|
|
20493
20546
|
}
|
|
@@ -20586,7 +20639,7 @@
|
|
|
20586
20639
|
next = _effect.next,
|
|
20587
20640
|
tag = _effect.tag;
|
|
20588
20641
|
|
|
20589
|
-
if ((tag & Passive$1) !==
|
|
20642
|
+
if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {
|
|
20590
20643
|
enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);
|
|
20591
20644
|
enqueuePendingPassiveHookEffectMount(finishedWork, effect);
|
|
20592
20645
|
}
|
|
@@ -20619,7 +20672,7 @@
|
|
|
20619
20672
|
{
|
|
20620
20673
|
var instance = finishedWork.stateNode;
|
|
20621
20674
|
|
|
20622
|
-
if (finishedWork.
|
|
20675
|
+
if (finishedWork.flags & Update) {
|
|
20623
20676
|
if (current === null) {
|
|
20624
20677
|
// We could update instance props and state here,
|
|
20625
20678
|
// but instead we rely on them being set during last render.
|
|
@@ -20723,7 +20776,7 @@
|
|
|
20723
20776
|
// These effects should only be committed when components are first mounted,
|
|
20724
20777
|
// aka when there is no current/alternate.
|
|
20725
20778
|
|
|
20726
|
-
if (current === null && finishedWork.
|
|
20779
|
+
if (current === null && finishedWork.flags & Update) {
|
|
20727
20780
|
var type = finishedWork.type;
|
|
20728
20781
|
var props = finishedWork.memoizedProps;
|
|
20729
20782
|
commitMount(_instance2, type, props);
|
|
@@ -20877,7 +20930,7 @@
|
|
|
20877
20930
|
// interrupt deletion, so it's okay
|
|
20878
20931
|
|
|
20879
20932
|
|
|
20880
|
-
function commitUnmount(finishedRoot, current,
|
|
20933
|
+
function commitUnmount(finishedRoot, current, renderPriorityLevel) {
|
|
20881
20934
|
onCommitUnmount(current);
|
|
20882
20935
|
|
|
20883
20936
|
switch (current.tag) {
|
|
@@ -20902,11 +20955,11 @@
|
|
|
20902
20955
|
tag = _effect2.tag;
|
|
20903
20956
|
|
|
20904
20957
|
if (destroy !== undefined) {
|
|
20905
|
-
if ((tag & Passive$1) !==
|
|
20958
|
+
if ((tag & Passive$1) !== NoFlags$1) {
|
|
20906
20959
|
enqueuePendingPassiveHookEffectUnmount(current, effect);
|
|
20907
20960
|
} else {
|
|
20908
20961
|
{
|
|
20909
|
-
safelyCallDestroy(current,
|
|
20962
|
+
safelyCallDestroy(current, destroy);
|
|
20910
20963
|
}
|
|
20911
20964
|
}
|
|
20912
20965
|
}
|
|
@@ -20921,11 +20974,11 @@
|
|
|
20921
20974
|
|
|
20922
20975
|
case ClassComponent:
|
|
20923
20976
|
{
|
|
20924
|
-
safelyDetachRef(current
|
|
20977
|
+
safelyDetachRef(current);
|
|
20925
20978
|
var instance = current.stateNode;
|
|
20926
20979
|
|
|
20927
20980
|
if (typeof instance.componentWillUnmount === 'function') {
|
|
20928
|
-
safelyCallComponentWillUnmount(current, instance
|
|
20981
|
+
safelyCallComponentWillUnmount(current, instance);
|
|
20929
20982
|
}
|
|
20930
20983
|
|
|
20931
20984
|
return;
|
|
@@ -20933,7 +20986,7 @@
|
|
|
20933
20986
|
|
|
20934
20987
|
case HostComponent:
|
|
20935
20988
|
{
|
|
20936
|
-
safelyDetachRef(current
|
|
20989
|
+
safelyDetachRef(current);
|
|
20937
20990
|
return;
|
|
20938
20991
|
}
|
|
20939
20992
|
|
|
@@ -20943,7 +20996,7 @@
|
|
|
20943
20996
|
// We are also not using this parent because
|
|
20944
20997
|
// the portal will get pushed immediately.
|
|
20945
20998
|
{
|
|
20946
|
-
unmountHostComponents(finishedRoot, current
|
|
20999
|
+
unmountHostComponents(finishedRoot, current);
|
|
20947
21000
|
}
|
|
20948
21001
|
|
|
20949
21002
|
return;
|
|
@@ -20969,7 +21022,7 @@
|
|
|
20969
21022
|
}
|
|
20970
21023
|
}
|
|
20971
21024
|
|
|
20972
|
-
function commitNestedUnmounts(finishedRoot, root,
|
|
21025
|
+
function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
|
|
20973
21026
|
// While we're inside a removed host node we don't want to call
|
|
20974
21027
|
// removeChild on the inner nodes because they're removed by the top
|
|
20975
21028
|
// call anyway. We also want to call componentWillUnmount on all
|
|
@@ -20978,7 +21031,7 @@
|
|
|
20978
21031
|
var node = root;
|
|
20979
21032
|
|
|
20980
21033
|
while (true) {
|
|
20981
|
-
commitUnmount(finishedRoot, node
|
|
21034
|
+
commitUnmount(finishedRoot, node); // Visit children because they may contain more composite or host nodes.
|
|
20982
21035
|
// Skip portals because commitUnmount() currently visits them recursively.
|
|
20983
21036
|
|
|
20984
21037
|
if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
|
|
@@ -21083,7 +21136,7 @@
|
|
|
21083
21136
|
while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
|
|
21084
21137
|
// If it is not host node and, we might have a host node inside it.
|
|
21085
21138
|
// Try to search down until we find one.
|
|
21086
|
-
if (node.
|
|
21139
|
+
if (node.flags & Placement) {
|
|
21087
21140
|
// If we don't have a child, try the siblings instead.
|
|
21088
21141
|
continue siblings;
|
|
21089
21142
|
} // If we don't have a child, try the siblings instead.
|
|
@@ -21099,7 +21152,7 @@
|
|
|
21099
21152
|
} // Check if this host node is stable or about to be placed.
|
|
21100
21153
|
|
|
21101
21154
|
|
|
21102
|
-
if (!(node.
|
|
21155
|
+
if (!(node.flags & Placement)) {
|
|
21103
21156
|
// Found it!
|
|
21104
21157
|
return node.stateNode;
|
|
21105
21158
|
}
|
|
@@ -21144,11 +21197,11 @@
|
|
|
21144
21197
|
|
|
21145
21198
|
}
|
|
21146
21199
|
|
|
21147
|
-
if (parentFiber.
|
|
21200
|
+
if (parentFiber.flags & ContentReset) {
|
|
21148
21201
|
// Reset the text content of the parent before doing any insertions
|
|
21149
21202
|
resetTextContent(parent); // Clear ContentReset from the effect tag
|
|
21150
21203
|
|
|
21151
|
-
parentFiber.
|
|
21204
|
+
parentFiber.flags &= ~ContentReset;
|
|
21152
21205
|
}
|
|
21153
21206
|
|
|
21154
21207
|
var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
|
|
@@ -21215,7 +21268,7 @@
|
|
|
21215
21268
|
}
|
|
21216
21269
|
}
|
|
21217
21270
|
|
|
21218
|
-
function unmountHostComponents(finishedRoot, current,
|
|
21271
|
+
function unmountHostComponents(finishedRoot, current, renderPriorityLevel) {
|
|
21219
21272
|
// We only have the top Fiber that was deleted but we need to recurse down its
|
|
21220
21273
|
// children to find all the terminal nodes.
|
|
21221
21274
|
var node = current; // Each iteration, currentParent is populated with node's host parent if not
|
|
@@ -21264,7 +21317,7 @@
|
|
|
21264
21317
|
}
|
|
21265
21318
|
|
|
21266
21319
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
21267
|
-
commitNestedUnmounts(finishedRoot, node
|
|
21320
|
+
commitNestedUnmounts(finishedRoot, node); // After all the children have unmounted, it is now safe to remove the
|
|
21268
21321
|
// node from the tree.
|
|
21269
21322
|
|
|
21270
21323
|
if (currentParentIsContainer) {
|
|
@@ -21285,7 +21338,7 @@
|
|
|
21285
21338
|
continue;
|
|
21286
21339
|
}
|
|
21287
21340
|
} else {
|
|
21288
|
-
commitUnmount(finishedRoot, node
|
|
21341
|
+
commitUnmount(finishedRoot, node); // Visit children because we may find more host components below.
|
|
21289
21342
|
|
|
21290
21343
|
if (node.child !== null) {
|
|
21291
21344
|
node.child.return = node;
|
|
@@ -21317,11 +21370,11 @@
|
|
|
21317
21370
|
}
|
|
21318
21371
|
}
|
|
21319
21372
|
|
|
21320
|
-
function commitDeletion(finishedRoot, current,
|
|
21373
|
+
function commitDeletion(finishedRoot, current, renderPriorityLevel) {
|
|
21321
21374
|
{
|
|
21322
21375
|
// Recursively delete all host nodes from the parent.
|
|
21323
21376
|
// Detach refs and call componentWillUnmount() on the whole subtree.
|
|
21324
|
-
unmountHostComponents(finishedRoot, current
|
|
21377
|
+
unmountHostComponents(finishedRoot, current);
|
|
21325
21378
|
}
|
|
21326
21379
|
|
|
21327
21380
|
var alternate = current.alternate;
|
|
@@ -21726,7 +21779,7 @@
|
|
|
21726
21779
|
currentEventTime = now();
|
|
21727
21780
|
return currentEventTime;
|
|
21728
21781
|
}
|
|
21729
|
-
function requestUpdateLane(fiber
|
|
21782
|
+
function requestUpdateLane(fiber) {
|
|
21730
21783
|
// Special cases
|
|
21731
21784
|
var mode = fiber.mode;
|
|
21732
21785
|
|
|
@@ -21754,10 +21807,9 @@
|
|
|
21754
21807
|
currentEventWipLanes = workInProgressRootIncludedLanes;
|
|
21755
21808
|
}
|
|
21756
21809
|
|
|
21757
|
-
|
|
21758
|
-
|
|
21759
|
-
|
|
21760
|
-
// TODO: This will coerce numbers larger than 31 bits to 0.
|
|
21810
|
+
var isTransition = requestCurrentTransition() !== NoTransition;
|
|
21811
|
+
|
|
21812
|
+
if (isTransition) {
|
|
21761
21813
|
if (currentEventPendingLanes !== NoLanes) {
|
|
21762
21814
|
currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;
|
|
21763
21815
|
}
|
|
@@ -21911,7 +21963,7 @@
|
|
|
21911
21963
|
}
|
|
21912
21964
|
|
|
21913
21965
|
{
|
|
21914
|
-
if (alternate === null && (sourceFiber.
|
|
21966
|
+
if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
21915
21967
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
21916
21968
|
}
|
|
21917
21969
|
} // Walk the parent path to the root and update the child expiration time.
|
|
@@ -21928,7 +21980,7 @@
|
|
|
21928
21980
|
alternate.childLanes = mergeLanes(alternate.childLanes, lane);
|
|
21929
21981
|
} else {
|
|
21930
21982
|
{
|
|
21931
|
-
if ((parent.
|
|
21983
|
+
if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
|
|
21932
21984
|
warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
|
|
21933
21985
|
}
|
|
21934
21986
|
}
|
|
@@ -22183,7 +22235,7 @@
|
|
|
22183
22235
|
if (!shouldForceFlushFallbacksInDEV()) {
|
|
22184
22236
|
// This is not a transition, but we did trigger an avoided state.
|
|
22185
22237
|
// Schedule a placeholder to display after a short delay, using the Just
|
|
22186
|
-
//
|
|
22238
|
+
// Noticeable Difference.
|
|
22187
22239
|
// TODO: Is the JND optimization worth the added complexity? If this is
|
|
22188
22240
|
// the only reason we track the event time, then probably not.
|
|
22189
22241
|
// Consider removing.
|
|
@@ -22782,7 +22834,7 @@
|
|
|
22782
22834
|
var current = completedWork.alternate;
|
|
22783
22835
|
var returnFiber = completedWork.return; // Check if the work completed or if something threw.
|
|
22784
22836
|
|
|
22785
|
-
if ((completedWork.
|
|
22837
|
+
if ((completedWork.flags & Incomplete) === NoFlags) {
|
|
22786
22838
|
setCurrentFiber(completedWork);
|
|
22787
22839
|
var next = void 0;
|
|
22788
22840
|
|
|
@@ -22806,7 +22858,7 @@
|
|
|
22806
22858
|
resetChildLanes(completedWork);
|
|
22807
22859
|
|
|
22808
22860
|
if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
|
|
22809
|
-
(returnFiber.
|
|
22861
|
+
(returnFiber.flags & Incomplete) === NoFlags) {
|
|
22810
22862
|
// Append all the effects of the subtree and this fiber onto the effect
|
|
22811
22863
|
// list of the parent. The completion order of the children affects the
|
|
22812
22864
|
// side-effect order.
|
|
@@ -22828,11 +22880,11 @@
|
|
|
22828
22880
|
// at the end.
|
|
22829
22881
|
|
|
22830
22882
|
|
|
22831
|
-
var
|
|
22883
|
+
var flags = completedWork.flags; // Skip both NoWork and PerformedWork tags when creating the effect
|
|
22832
22884
|
// list. PerformedWork effect is read by React DevTools but shouldn't be
|
|
22833
22885
|
// committed.
|
|
22834
22886
|
|
|
22835
|
-
if (
|
|
22887
|
+
if (flags > PerformedWork) {
|
|
22836
22888
|
if (returnFiber.lastEffect !== null) {
|
|
22837
22889
|
returnFiber.lastEffect.nextEffect = completedWork;
|
|
22838
22890
|
} else {
|
|
@@ -22854,7 +22906,7 @@
|
|
|
22854
22906
|
// back here again.
|
|
22855
22907
|
// Since we're restarting, remove anything that is not a host effect
|
|
22856
22908
|
// from the effect tag.
|
|
22857
|
-
_next.
|
|
22909
|
+
_next.flags &= HostEffectMask;
|
|
22858
22910
|
workInProgress = _next;
|
|
22859
22911
|
return;
|
|
22860
22912
|
}
|
|
@@ -22877,7 +22929,7 @@
|
|
|
22877
22929
|
if (returnFiber !== null) {
|
|
22878
22930
|
// Mark the parent fiber as incomplete and clear its effect list.
|
|
22879
22931
|
returnFiber.firstEffect = returnFiber.lastEffect = null;
|
|
22880
|
-
returnFiber.
|
|
22932
|
+
returnFiber.flags |= Incomplete;
|
|
22881
22933
|
}
|
|
22882
22934
|
}
|
|
22883
22935
|
|
|
@@ -23031,7 +23083,7 @@
|
|
|
23031
23083
|
|
|
23032
23084
|
var firstEffect;
|
|
23033
23085
|
|
|
23034
|
-
if (finishedWork.
|
|
23086
|
+
if (finishedWork.flags > PerformedWork) {
|
|
23035
23087
|
// A fiber's effect list consists only of its children, not itself. So if
|
|
23036
23088
|
// the root has an effect, we need to add it to the end of the list. The
|
|
23037
23089
|
// resulting list is the set that would belong to the root's parent, if it
|
|
@@ -23076,7 +23128,7 @@
|
|
|
23076
23128
|
}
|
|
23077
23129
|
|
|
23078
23130
|
var error = clearCaughtError();
|
|
23079
|
-
captureCommitPhaseError(nextEffect,
|
|
23131
|
+
captureCommitPhaseError(nextEffect, error);
|
|
23080
23132
|
nextEffect = nextEffect.nextEffect;
|
|
23081
23133
|
}
|
|
23082
23134
|
}
|
|
@@ -23107,7 +23159,7 @@
|
|
|
23107
23159
|
|
|
23108
23160
|
var _error = clearCaughtError();
|
|
23109
23161
|
|
|
23110
|
-
captureCommitPhaseError(nextEffect,
|
|
23162
|
+
captureCommitPhaseError(nextEffect, _error);
|
|
23111
23163
|
nextEffect = nextEffect.nextEffect;
|
|
23112
23164
|
}
|
|
23113
23165
|
}
|
|
@@ -23137,7 +23189,7 @@
|
|
|
23137
23189
|
|
|
23138
23190
|
var _error2 = clearCaughtError();
|
|
23139
23191
|
|
|
23140
|
-
captureCommitPhaseError(nextEffect,
|
|
23192
|
+
captureCommitPhaseError(nextEffect, _error2);
|
|
23141
23193
|
nextEffect = nextEffect.nextEffect;
|
|
23142
23194
|
}
|
|
23143
23195
|
}
|
|
@@ -23183,7 +23235,7 @@
|
|
|
23183
23235
|
var nextNextEffect = nextEffect.nextEffect;
|
|
23184
23236
|
nextEffect.nextEffect = null;
|
|
23185
23237
|
|
|
23186
|
-
if (nextEffect.
|
|
23238
|
+
if (nextEffect.flags & Deletion) {
|
|
23187
23239
|
detachFiberAfterEffects(nextEffect);
|
|
23188
23240
|
}
|
|
23189
23241
|
|
|
@@ -23273,7 +23325,7 @@
|
|
|
23273
23325
|
var current = nextEffect.alternate;
|
|
23274
23326
|
|
|
23275
23327
|
if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {
|
|
23276
|
-
if ((nextEffect.
|
|
23328
|
+
if ((nextEffect.flags & Deletion) !== NoFlags) {
|
|
23277
23329
|
if (doesFiberContain(nextEffect, focusedInstanceHandle)) {
|
|
23278
23330
|
shouldFireAfterActiveInstanceBlur = true;
|
|
23279
23331
|
}
|
|
@@ -23285,15 +23337,15 @@
|
|
|
23285
23337
|
}
|
|
23286
23338
|
}
|
|
23287
23339
|
|
|
23288
|
-
var
|
|
23340
|
+
var flags = nextEffect.flags;
|
|
23289
23341
|
|
|
23290
|
-
if ((
|
|
23342
|
+
if ((flags & Snapshot) !== NoFlags) {
|
|
23291
23343
|
setCurrentFiber(nextEffect);
|
|
23292
23344
|
commitBeforeMutationLifeCycles(current, nextEffect);
|
|
23293
23345
|
resetCurrentFiber();
|
|
23294
23346
|
}
|
|
23295
23347
|
|
|
23296
|
-
if ((
|
|
23348
|
+
if ((flags & Passive) !== NoFlags) {
|
|
23297
23349
|
// If there are passive effects, schedule a callback to flush at
|
|
23298
23350
|
// the earliest opportunity.
|
|
23299
23351
|
if (!rootDoesHavePassiveEffects) {
|
|
@@ -23313,13 +23365,13 @@
|
|
|
23313
23365
|
// TODO: Should probably move the bulk of this function to commitWork.
|
|
23314
23366
|
while (nextEffect !== null) {
|
|
23315
23367
|
setCurrentFiber(nextEffect);
|
|
23316
|
-
var
|
|
23368
|
+
var flags = nextEffect.flags;
|
|
23317
23369
|
|
|
23318
|
-
if (
|
|
23370
|
+
if (flags & ContentReset) {
|
|
23319
23371
|
commitResetTextContent(nextEffect);
|
|
23320
23372
|
}
|
|
23321
23373
|
|
|
23322
|
-
if (
|
|
23374
|
+
if (flags & Ref) {
|
|
23323
23375
|
var current = nextEffect.alternate;
|
|
23324
23376
|
|
|
23325
23377
|
if (current !== null) {
|
|
@@ -23331,9 +23383,9 @@
|
|
|
23331
23383
|
// switch on that value.
|
|
23332
23384
|
|
|
23333
23385
|
|
|
23334
|
-
var
|
|
23386
|
+
var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);
|
|
23335
23387
|
|
|
23336
|
-
switch (
|
|
23388
|
+
switch (primaryFlags) {
|
|
23337
23389
|
case Placement:
|
|
23338
23390
|
{
|
|
23339
23391
|
commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
|
|
@@ -23341,7 +23393,7 @@
|
|
|
23341
23393
|
// TODO: findDOMNode doesn't rely on this any more but isMounted does
|
|
23342
23394
|
// and isMounted is deprecated anyway so we should be able to kill this.
|
|
23343
23395
|
|
|
23344
|
-
nextEffect.
|
|
23396
|
+
nextEffect.flags &= ~Placement;
|
|
23345
23397
|
break;
|
|
23346
23398
|
}
|
|
23347
23399
|
|
|
@@ -23351,7 +23403,7 @@
|
|
|
23351
23403
|
commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
|
|
23352
23404
|
// inserted, before any life-cycles like componentDidMount gets called.
|
|
23353
23405
|
|
|
23354
|
-
nextEffect.
|
|
23406
|
+
nextEffect.flags &= ~Placement; // Update
|
|
23355
23407
|
|
|
23356
23408
|
var _current = nextEffect.alternate;
|
|
23357
23409
|
commitWork(_current, nextEffect);
|
|
@@ -23360,13 +23412,13 @@
|
|
|
23360
23412
|
|
|
23361
23413
|
case Hydrating:
|
|
23362
23414
|
{
|
|
23363
|
-
nextEffect.
|
|
23415
|
+
nextEffect.flags &= ~Hydrating;
|
|
23364
23416
|
break;
|
|
23365
23417
|
}
|
|
23366
23418
|
|
|
23367
23419
|
case HydratingAndUpdate:
|
|
23368
23420
|
{
|
|
23369
|
-
nextEffect.
|
|
23421
|
+
nextEffect.flags &= ~Hydrating; // Update
|
|
23370
23422
|
|
|
23371
23423
|
var _current2 = nextEffect.alternate;
|
|
23372
23424
|
commitWork(_current2, nextEffect);
|
|
@@ -23382,7 +23434,7 @@
|
|
|
23382
23434
|
|
|
23383
23435
|
case Deletion:
|
|
23384
23436
|
{
|
|
23385
|
-
commitDeletion(root, nextEffect
|
|
23437
|
+
commitDeletion(root, nextEffect);
|
|
23386
23438
|
break;
|
|
23387
23439
|
}
|
|
23388
23440
|
}
|
|
@@ -23397,15 +23449,15 @@
|
|
|
23397
23449
|
|
|
23398
23450
|
while (nextEffect !== null) {
|
|
23399
23451
|
setCurrentFiber(nextEffect);
|
|
23400
|
-
var
|
|
23452
|
+
var flags = nextEffect.flags;
|
|
23401
23453
|
|
|
23402
|
-
if (
|
|
23454
|
+
if (flags & (Update | Callback)) {
|
|
23403
23455
|
var current = nextEffect.alternate;
|
|
23404
23456
|
commitLifeCycles(root, current, nextEffect);
|
|
23405
23457
|
}
|
|
23406
23458
|
|
|
23407
23459
|
{
|
|
23408
|
-
if (
|
|
23460
|
+
if (flags & Ref) {
|
|
23409
23461
|
commitAttachRef(nextEffect);
|
|
23410
23462
|
}
|
|
23411
23463
|
}
|
|
@@ -23443,11 +23495,11 @@
|
|
|
23443
23495
|
pendingPassiveHookEffectsUnmount.push(effect, fiber);
|
|
23444
23496
|
|
|
23445
23497
|
{
|
|
23446
|
-
fiber.
|
|
23498
|
+
fiber.flags |= PassiveUnmountPendingDev;
|
|
23447
23499
|
var alternate = fiber.alternate;
|
|
23448
23500
|
|
|
23449
23501
|
if (alternate !== null) {
|
|
23450
|
-
alternate.
|
|
23502
|
+
alternate.flags |= PassiveUnmountPendingDev;
|
|
23451
23503
|
}
|
|
23452
23504
|
}
|
|
23453
23505
|
|
|
@@ -23505,11 +23557,11 @@
|
|
|
23505
23557
|
_effect.destroy = undefined;
|
|
23506
23558
|
|
|
23507
23559
|
{
|
|
23508
|
-
fiber.
|
|
23560
|
+
fiber.flags &= ~PassiveUnmountPendingDev;
|
|
23509
23561
|
var alternate = fiber.alternate;
|
|
23510
23562
|
|
|
23511
23563
|
if (alternate !== null) {
|
|
23512
|
-
alternate.
|
|
23564
|
+
alternate.flags &= ~PassiveUnmountPendingDev;
|
|
23513
23565
|
}
|
|
23514
23566
|
}
|
|
23515
23567
|
|
|
@@ -23529,7 +23581,7 @@
|
|
|
23529
23581
|
}
|
|
23530
23582
|
|
|
23531
23583
|
var error = clearCaughtError();
|
|
23532
|
-
captureCommitPhaseError(fiber,
|
|
23584
|
+
captureCommitPhaseError(fiber, error);
|
|
23533
23585
|
}
|
|
23534
23586
|
|
|
23535
23587
|
resetCurrentFiber();
|
|
@@ -23561,7 +23613,7 @@
|
|
|
23561
23613
|
|
|
23562
23614
|
var _error4 = clearCaughtError();
|
|
23563
23615
|
|
|
23564
|
-
captureCommitPhaseError(_fiber,
|
|
23616
|
+
captureCommitPhaseError(_fiber, _error4);
|
|
23565
23617
|
}
|
|
23566
23618
|
|
|
23567
23619
|
resetCurrentFiber();
|
|
@@ -23578,7 +23630,7 @@
|
|
|
23578
23630
|
|
|
23579
23631
|
effect.nextEffect = null;
|
|
23580
23632
|
|
|
23581
|
-
if (effect.
|
|
23633
|
+
if (effect.flags & Deletion) {
|
|
23582
23634
|
detachFiberAfterEffects(effect);
|
|
23583
23635
|
}
|
|
23584
23636
|
|
|
@@ -23636,7 +23688,7 @@
|
|
|
23636
23688
|
}
|
|
23637
23689
|
}
|
|
23638
23690
|
|
|
23639
|
-
function captureCommitPhaseError(sourceFiber,
|
|
23691
|
+
function captureCommitPhaseError(sourceFiber, error) {
|
|
23640
23692
|
if (sourceFiber.tag === HostRoot) {
|
|
23641
23693
|
// Error was thrown at the root. There is no parent, so the root
|
|
23642
23694
|
// itself should capture it.
|
|
@@ -23644,11 +23696,7 @@
|
|
|
23644
23696
|
return;
|
|
23645
23697
|
}
|
|
23646
23698
|
|
|
23647
|
-
var fiber =
|
|
23648
|
-
|
|
23649
|
-
{
|
|
23650
|
-
fiber = sourceFiber.return;
|
|
23651
|
-
}
|
|
23699
|
+
var fiber = sourceFiber.return;
|
|
23652
23700
|
|
|
23653
23701
|
while (fiber !== null) {
|
|
23654
23702
|
if (fiber.tag === HostRoot) {
|
|
@@ -23869,7 +23917,7 @@
|
|
|
23869
23917
|
// we can assume that they would have prevented this update.
|
|
23870
23918
|
|
|
23871
23919
|
|
|
23872
|
-
if ((fiber.
|
|
23920
|
+
if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {
|
|
23873
23921
|
return;
|
|
23874
23922
|
} // We show the whole stack but dedupe on the top component's name because
|
|
23875
23923
|
// the problematic code almost always lies inside that component.
|
|
@@ -24214,27 +24262,15 @@
|
|
|
24214
24262
|
});
|
|
24215
24263
|
}
|
|
24216
24264
|
} // `act` testing API
|
|
24217
|
-
//
|
|
24218
|
-
// TODO: This is mostly a copy-paste from the legacy `act`, which does not have
|
|
24219
|
-
// access to the same internals that we do here. Some trade offs in the
|
|
24220
|
-
// implementation no longer make sense.
|
|
24221
|
-
|
|
24222
|
-
|
|
24223
|
-
var isFlushingAct = false;
|
|
24224
|
-
var isInsideThisAct = false; // TODO: Yes, this is confusing. See above comment. We'll refactor it.
|
|
24225
24265
|
|
|
24226
24266
|
function shouldForceFlushFallbacksInDEV() {
|
|
24267
|
+
// Never force flush in production. This function should get stripped out.
|
|
24268
|
+
return actingUpdatesScopeDepth > 0;
|
|
24269
|
+
}
|
|
24270
|
+
// so we can tell if any async act() calls try to run in parallel.
|
|
24227
24271
|
|
|
24228
24272
|
|
|
24229
|
-
|
|
24230
|
-
// `isInsideAct` is only used by the reconciler implementation of `act`.
|
|
24231
|
-
// We don't want to flush suspense fallbacks until the end.
|
|
24232
|
-
return !isInsideThisAct;
|
|
24233
|
-
} // Flush callbacks at the end.
|
|
24234
|
-
|
|
24235
|
-
|
|
24236
|
-
return isFlushingAct;
|
|
24237
|
-
}
|
|
24273
|
+
var actingUpdatesScopeDepth = 0;
|
|
24238
24274
|
|
|
24239
24275
|
function detachFiberAfterEffects(fiber) {
|
|
24240
24276
|
fiber.sibling = null;
|
|
@@ -24677,7 +24713,7 @@
|
|
|
24677
24713
|
this.dependencies = null;
|
|
24678
24714
|
this.mode = mode; // Effects
|
|
24679
24715
|
|
|
24680
|
-
this.
|
|
24716
|
+
this.flags = NoFlags;
|
|
24681
24717
|
this.nextEffect = null;
|
|
24682
24718
|
this.firstEffect = null;
|
|
24683
24719
|
this.lastEffect = null;
|
|
@@ -24799,7 +24835,7 @@
|
|
|
24799
24835
|
workInProgress.type = current.type; // We already have an alternate.
|
|
24800
24836
|
// Reset the effect tag.
|
|
24801
24837
|
|
|
24802
|
-
workInProgress.
|
|
24838
|
+
workInProgress.flags = NoFlags; // The effect list is no longer valid.
|
|
24803
24839
|
|
|
24804
24840
|
workInProgress.nextEffect = null;
|
|
24805
24841
|
workInProgress.firstEffect = null;
|
|
@@ -24870,7 +24906,7 @@
|
|
|
24870
24906
|
// avoid doing another reconciliation.
|
|
24871
24907
|
// Reset the effect tag but keep any Placement tags, since that's something
|
|
24872
24908
|
// that child fiber is setting, not the reconciliation.
|
|
24873
|
-
workInProgress.
|
|
24909
|
+
workInProgress.flags &= Placement; // The effect list is no longer valid.
|
|
24874
24910
|
|
|
24875
24911
|
workInProgress.nextEffect = null;
|
|
24876
24912
|
workInProgress.firstEffect = null;
|
|
@@ -25218,7 +25254,7 @@
|
|
|
25218
25254
|
target.memoizedState = source.memoizedState;
|
|
25219
25255
|
target.dependencies = source.dependencies;
|
|
25220
25256
|
target.mode = source.mode;
|
|
25221
|
-
target.
|
|
25257
|
+
target.flags = source.flags;
|
|
25222
25258
|
target.nextEffect = source.nextEffect;
|
|
25223
25259
|
target.firstEffect = source.firstEffect;
|
|
25224
25260
|
target.lastEffect = source.lastEffect;
|
|
@@ -25436,8 +25472,7 @@
|
|
|
25436
25472
|
}
|
|
25437
25473
|
}
|
|
25438
25474
|
|
|
25439
|
-
var
|
|
25440
|
-
var lane = requestUpdateLane(current$1, suspenseConfig);
|
|
25475
|
+
var lane = requestUpdateLane(current$1);
|
|
25441
25476
|
|
|
25442
25477
|
var context = getContextForSubtree(parentComponent);
|
|
25443
25478
|
|
|
@@ -25547,7 +25582,7 @@
|
|
|
25547
25582
|
}
|
|
25548
25583
|
|
|
25549
25584
|
var eventTime = requestEventTime();
|
|
25550
|
-
var lane = requestUpdateLane(fiber
|
|
25585
|
+
var lane = requestUpdateLane(fiber);
|
|
25551
25586
|
scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
25552
25587
|
markRetryLaneIfNotHydrated(fiber, lane);
|
|
25553
25588
|
}
|
|
@@ -25581,29 +25616,96 @@
|
|
|
25581
25616
|
return shouldSuspendImpl(fiber);
|
|
25582
25617
|
}
|
|
25583
25618
|
var overrideHookState = null;
|
|
25619
|
+
var overrideHookStateDeletePath = null;
|
|
25620
|
+
var overrideHookStateRenamePath = null;
|
|
25584
25621
|
var overrideProps = null;
|
|
25622
|
+
var overridePropsDeletePath = null;
|
|
25623
|
+
var overridePropsRenamePath = null;
|
|
25585
25624
|
var scheduleUpdate = null;
|
|
25586
25625
|
var setSuspenseHandler = null;
|
|
25587
25626
|
|
|
25588
25627
|
{
|
|
25589
|
-
var
|
|
25590
|
-
|
|
25628
|
+
var copyWithDeleteImpl = function (obj, path, index) {
|
|
25629
|
+
var key = path[index];
|
|
25630
|
+
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
|
25631
|
+
|
|
25632
|
+
if (index + 1 === path.length) {
|
|
25633
|
+
if (Array.isArray(updated)) {
|
|
25634
|
+
updated.splice(key, 1);
|
|
25635
|
+
} else {
|
|
25636
|
+
delete updated[key];
|
|
25637
|
+
}
|
|
25638
|
+
|
|
25639
|
+
return updated;
|
|
25640
|
+
} // $FlowFixMe number or string is fine here
|
|
25641
|
+
|
|
25642
|
+
|
|
25643
|
+
updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
|
|
25644
|
+
return updated;
|
|
25645
|
+
};
|
|
25646
|
+
|
|
25647
|
+
var copyWithDelete = function (obj, path) {
|
|
25648
|
+
return copyWithDeleteImpl(obj, path, 0);
|
|
25649
|
+
};
|
|
25650
|
+
|
|
25651
|
+
var copyWithRenameImpl = function (obj, oldPath, newPath, index) {
|
|
25652
|
+
var oldKey = oldPath[index];
|
|
25653
|
+
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
|
25654
|
+
|
|
25655
|
+
if (index + 1 === oldPath.length) {
|
|
25656
|
+
var newKey = newPath[index]; // $FlowFixMe number or string is fine here
|
|
25657
|
+
|
|
25658
|
+
updated[newKey] = updated[oldKey];
|
|
25659
|
+
|
|
25660
|
+
if (Array.isArray(updated)) {
|
|
25661
|
+
updated.splice(oldKey, 1);
|
|
25662
|
+
} else {
|
|
25663
|
+
delete updated[oldKey];
|
|
25664
|
+
}
|
|
25665
|
+
} else {
|
|
25666
|
+
// $FlowFixMe number or string is fine here
|
|
25667
|
+
updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here
|
|
25668
|
+
obj[oldKey], oldPath, newPath, index + 1);
|
|
25669
|
+
}
|
|
25670
|
+
|
|
25671
|
+
return updated;
|
|
25672
|
+
};
|
|
25673
|
+
|
|
25674
|
+
var copyWithRename = function (obj, oldPath, newPath) {
|
|
25675
|
+
if (oldPath.length !== newPath.length) {
|
|
25676
|
+
warn('copyWithRename() expects paths of the same length');
|
|
25677
|
+
|
|
25678
|
+
return;
|
|
25679
|
+
} else {
|
|
25680
|
+
for (var i = 0; i < newPath.length - 1; i++) {
|
|
25681
|
+
if (oldPath[i] !== newPath[i]) {
|
|
25682
|
+
warn('copyWithRename() expects paths to be the same except for the deepest key');
|
|
25683
|
+
|
|
25684
|
+
return;
|
|
25685
|
+
}
|
|
25686
|
+
}
|
|
25687
|
+
}
|
|
25688
|
+
|
|
25689
|
+
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
25690
|
+
};
|
|
25691
|
+
|
|
25692
|
+
var copyWithSetImpl = function (obj, path, index, value) {
|
|
25693
|
+
if (index >= path.length) {
|
|
25591
25694
|
return value;
|
|
25592
25695
|
}
|
|
25593
25696
|
|
|
25594
|
-
var key = path[
|
|
25697
|
+
var key = path[index];
|
|
25595
25698
|
var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here
|
|
25596
25699
|
|
|
25597
|
-
updated[key] = copyWithSetImpl(obj[key], path,
|
|
25700
|
+
updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
|
|
25598
25701
|
return updated;
|
|
25599
25702
|
};
|
|
25600
25703
|
|
|
25601
25704
|
var copyWithSet = function (obj, path, value) {
|
|
25602
25705
|
return copyWithSetImpl(obj, path, 0, value);
|
|
25603
|
-
};
|
|
25604
|
-
|
|
25706
|
+
};
|
|
25605
25707
|
|
|
25606
|
-
|
|
25708
|
+
var findHook = function (fiber, id) {
|
|
25607
25709
|
// For now, the "id" of stateful hooks is just the stateful hook index.
|
|
25608
25710
|
// This may change in the future with e.g. nested hooks.
|
|
25609
25711
|
var currentHook = fiber.memoizedState;
|
|
@@ -25613,10 +25715,51 @@
|
|
|
25613
25715
|
id--;
|
|
25614
25716
|
}
|
|
25615
25717
|
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
|
|
25619
|
-
|
|
25718
|
+
return currentHook;
|
|
25719
|
+
}; // Support DevTools editable values for useState and useReducer.
|
|
25720
|
+
|
|
25721
|
+
|
|
25722
|
+
overrideHookState = function (fiber, id, path, value) {
|
|
25723
|
+
var hook = findHook(fiber, id);
|
|
25724
|
+
|
|
25725
|
+
if (hook !== null) {
|
|
25726
|
+
var newState = copyWithSet(hook.memoizedState, path, value);
|
|
25727
|
+
hook.memoizedState = newState;
|
|
25728
|
+
hook.baseState = newState; // We aren't actually adding an update to the queue,
|
|
25729
|
+
// because there is no update we can add for useReducer hooks that won't trigger an error.
|
|
25730
|
+
// (There's no appropriate action type for DevTools overrides.)
|
|
25731
|
+
// As a result though, React will see the scheduled update as a noop and bailout.
|
|
25732
|
+
// Shallow cloning props works as a workaround for now to bypass the bailout check.
|
|
25733
|
+
|
|
25734
|
+
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
|
|
25735
|
+
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25736
|
+
}
|
|
25737
|
+
};
|
|
25738
|
+
|
|
25739
|
+
overrideHookStateDeletePath = function (fiber, id, path) {
|
|
25740
|
+
var hook = findHook(fiber, id);
|
|
25741
|
+
|
|
25742
|
+
if (hook !== null) {
|
|
25743
|
+
var newState = copyWithDelete(hook.memoizedState, path);
|
|
25744
|
+
hook.memoizedState = newState;
|
|
25745
|
+
hook.baseState = newState; // We aren't actually adding an update to the queue,
|
|
25746
|
+
// because there is no update we can add for useReducer hooks that won't trigger an error.
|
|
25747
|
+
// (There's no appropriate action type for DevTools overrides.)
|
|
25748
|
+
// As a result though, React will see the scheduled update as a noop and bailout.
|
|
25749
|
+
// Shallow cloning props works as a workaround for now to bypass the bailout check.
|
|
25750
|
+
|
|
25751
|
+
fiber.memoizedProps = _assign({}, fiber.memoizedProps);
|
|
25752
|
+
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25753
|
+
}
|
|
25754
|
+
};
|
|
25755
|
+
|
|
25756
|
+
overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {
|
|
25757
|
+
var hook = findHook(fiber, id);
|
|
25758
|
+
|
|
25759
|
+
if (hook !== null) {
|
|
25760
|
+
var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
|
|
25761
|
+
hook.memoizedState = newState;
|
|
25762
|
+
hook.baseState = newState; // We aren't actually adding an update to the queue,
|
|
25620
25763
|
// because there is no update we can add for useReducer hooks that won't trigger an error.
|
|
25621
25764
|
// (There's no appropriate action type for DevTools overrides.)
|
|
25622
25765
|
// As a result though, React will see the scheduled update as a noop and bailout.
|
|
@@ -25638,6 +25781,26 @@
|
|
|
25638
25781
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25639
25782
|
};
|
|
25640
25783
|
|
|
25784
|
+
overridePropsDeletePath = function (fiber, path) {
|
|
25785
|
+
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
|
|
25786
|
+
|
|
25787
|
+
if (fiber.alternate) {
|
|
25788
|
+
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
25789
|
+
}
|
|
25790
|
+
|
|
25791
|
+
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25792
|
+
};
|
|
25793
|
+
|
|
25794
|
+
overridePropsRenamePath = function (fiber, oldPath, newPath) {
|
|
25795
|
+
fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
|
|
25796
|
+
|
|
25797
|
+
if (fiber.alternate) {
|
|
25798
|
+
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
25799
|
+
}
|
|
25800
|
+
|
|
25801
|
+
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25802
|
+
};
|
|
25803
|
+
|
|
25641
25804
|
scheduleUpdate = function (fiber) {
|
|
25642
25805
|
scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
|
|
25643
25806
|
};
|
|
@@ -25674,7 +25837,11 @@
|
|
|
25674
25837
|
rendererPackageName: devToolsConfig.rendererPackageName,
|
|
25675
25838
|
rendererConfig: devToolsConfig.rendererConfig,
|
|
25676
25839
|
overrideHookState: overrideHookState,
|
|
25840
|
+
overrideHookStateDeletePath: overrideHookStateDeletePath,
|
|
25841
|
+
overrideHookStateRenamePath: overrideHookStateRenamePath,
|
|
25677
25842
|
overrideProps: overrideProps,
|
|
25843
|
+
overridePropsDeletePath: overridePropsDeletePath,
|
|
25844
|
+
overridePropsRenamePath: overridePropsRenamePath,
|
|
25678
25845
|
setSuspenseHandler: setSuspenseHandler,
|
|
25679
25846
|
scheduleUpdate: scheduleUpdate,
|
|
25680
25847
|
currentDispatcherRef: ReactCurrentDispatcher,
|
|
@@ -26086,7 +26253,8 @@
|
|
|
26086
26253
|
var Internals = {
|
|
26087
26254
|
// Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
|
|
26088
26255
|
// This is an array for better minification.
|
|
26089
|
-
Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects,
|
|
26256
|
+
Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects, // TODO: This is related to `act`, not events. Move to separate key?
|
|
26257
|
+
IsThisRendererActing]
|
|
26090
26258
|
};
|
|
26091
26259
|
var foundDevTools = injectIntoDevTools({
|
|
26092
26260
|
findFiberByHostInstance: getClosestInstanceFromNode,
|