|
5093 | 5093 | (workInProgress.flags = 0), |
5094 | 5094 | (workInProgress.subtreeFlags = 0), |
5095 | 5095 | (workInProgress.deletions = null), |
| 5096 | + (workInProgress.key = current.key), |
5096 | 5097 | (workInProgress.actualDuration = -0), |
5097 | 5098 | (workInProgress.actualStartTime = -1.1)); |
5098 | 5099 | workInProgress.flags = current.flags & 132120576; |
|
5156 | 5157 | (workInProgress.memoizedState = current.memoizedState), |
5157 | 5158 | (workInProgress.updateQueue = current.updateQueue), |
5158 | 5159 | (workInProgress.type = current.type), |
| 5160 | + (workInProgress.key = current.key), |
5159 | 5161 | (renderLanes = current.dependencies), |
5160 | 5162 | (workInProgress.dependencies = |
5161 | 5163 | null === renderLanes |
|
6599 | 6601 | } |
6600 | 6602 | function mapRemainingChildren(currentFirstChild) { |
6601 | 6603 | for (var existingChildren = new Map(); null !== currentFirstChild; ) |
6602 | | - null !== currentFirstChild.key |
6603 | | - ? existingChildren.set(currentFirstChild.key, currentFirstChild) |
6604 | | - : existingChildren.set(currentFirstChild.index, currentFirstChild), |
| 6604 | + null === currentFirstChild.key |
| 6605 | + ? existingChildren.set(currentFirstChild.index, currentFirstChild) |
| 6606 | + : currentFirstChild.key === REACT_OPTIMISTIC_KEY |
| 6607 | + ? existingChildren.set( |
| 6608 | + -currentFirstChild.index - 1, |
| 6609 | + currentFirstChild |
| 6610 | + ) |
| 6611 | + : existingChildren.set(currentFirstChild.key, currentFirstChild), |
6605 | 6612 | (currentFirstChild = currentFirstChild.sibling); |
6606 | 6613 | return existingChildren; |
6607 | 6614 | } |
|
6697 | 6704 | current.stateNode.implementation !== portal.implementation |
6698 | 6705 | ) |
6699 | 6706 | return ( |
6700 | | - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), |
6701 | | - (current.return = returnFiber), |
6702 | | - (current._debugInfo = currentDebugInfo), |
6703 | | - current |
| 6707 | + (portal = createFiberFromPortal(portal, returnFiber.mode, lanes)), |
| 6708 | + (portal.return = returnFiber), |
| 6709 | + (portal._debugInfo = currentDebugInfo), |
| 6710 | + portal |
6704 | 6711 | ); |
6705 | 6712 | current = useFiber(current, portal.children || []); |
| 6713 | + current.key = portal.key; |
6706 | 6714 | current.return = returnFiber; |
6707 | 6715 | current._debugInfo = currentDebugInfo; |
6708 | 6716 | return current; |
6709 | 6717 | } |
6710 | 6718 | function updateFragment(returnFiber, current, fragment, lanes, key) { |
6711 | 6719 | if (null === current || 7 !== current.tag) |
6712 | 6720 | return ( |
6713 | | - (current = createFiberFromFragment( |
| 6721 | + (key = createFiberFromFragment( |
6714 | 6722 | fragment, |
6715 | 6723 | returnFiber.mode, |
6716 | 6724 | lanes, |
6717 | 6725 | key |
6718 | 6726 | )), |
6719 | | - (current.return = returnFiber), |
6720 | | - (current._debugOwner = returnFiber), |
6721 | | - (current._debugTask = returnFiber._debugTask), |
6722 | | - (current._debugInfo = currentDebugInfo), |
6723 | | - current |
| 6727 | + (key.return = returnFiber), |
| 6728 | + (key._debugOwner = returnFiber), |
| 6729 | + (key._debugTask = returnFiber._debugTask), |
| 6730 | + (key._debugInfo = currentDebugInfo), |
| 6731 | + key |
6724 | 6732 | ); |
6725 | 6733 | current = useFiber(current, fragment); |
| 6734 | + current.key = key; |
6726 | 6735 | current.return = returnFiber; |
6727 | 6736 | current._debugInfo = currentDebugInfo; |
6728 | 6737 | return current; |
|
6931 | 6940 | (newIdx = |
6932 | 6941 | existingChildren.get( |
6933 | 6942 | null === newChild.key ? newIdx : newChild.key |
6934 | | - ) || null), |
| 6943 | + ) || |
| 6944 | + existingChildren.get(-newIdx - 1) || |
| 6945 | + null), |
6935 | 6946 | (existingChildren = pushDebugInfo(newChild._debugInfo)), |
6936 | 6947 | (returnFiber = updateElement( |
6937 | 6948 | returnFiber, |
|
6947 | 6958 | (existingChildren = |
6948 | 6959 | existingChildren.get( |
6949 | 6960 | null === newChild.key ? newIdx : newChild.key |
6950 | | - ) || null), |
| 6961 | + ) || |
| 6962 | + existingChildren.get(-newIdx - 1) || |
| 6963 | + null), |
6951 | 6964 | updatePortal(returnFiber, existingChildren, newChild, lanes) |
6952 | 6965 | ); |
6953 | 6966 | case REACT_LAZY_TYPE: |
|
7133 | 7146 | knownKeys |
7134 | 7147 | )), |
7135 | 7148 | shouldTrackSideEffects && |
7136 | | - null !== nextOldFiber.alternate && |
7137 | | - oldFiber.delete( |
7138 | | - null === nextOldFiber.key ? newIdx : nextOldFiber.key |
7139 | | - ), |
| 7149 | + ((newFiber = nextOldFiber.alternate), |
| 7150 | + null !== newFiber && |
| 7151 | + (newFiber.key === REACT_OPTIMISTIC_KEY |
| 7152 | + ? oldFiber.delete(-newIdx - 1) |
| 7153 | + : oldFiber.delete( |
| 7154 | + null === newFiber.key ? newIdx : newFiber.key |
| 7155 | + ))), |
7140 | 7156 | (currentFirstChild = placeChild( |
7141 | 7157 | nextOldFiber, |
7142 | 7158 | currentFirstChild, |
|
7276 | 7292 | knownKeys |
7277 | 7293 | )), |
7278 | 7294 | shouldTrackSideEffects && |
7279 | | - null !== nextOldFiber.alternate && |
7280 | | - oldFiber.delete( |
7281 | | - null === nextOldFiber.key ? newIdx : nextOldFiber.key |
7282 | | - ), |
| 7295 | + ((step = nextOldFiber.alternate), |
| 7296 | + null !== step && |
| 7297 | + (step.key === REACT_OPTIMISTIC_KEY |
| 7298 | + ? oldFiber.delete(-newIdx - 1) |
| 7299 | + : oldFiber.delete(null === step.key ? newIdx : step.key))), |
7283 | 7300 | (currentFirstChild = placeChild( |
7284 | 7301 | nextOldFiber, |
7285 | 7302 | currentFirstChild, |
|
7315 | 7332 | var prevDebugInfo = pushDebugInfo(newChild._debugInfo); |
7316 | 7333 | a: { |
7317 | 7334 | for (var key = newChild.key; null !== currentFirstChild; ) { |
7318 | | - if (currentFirstChild.key === key) { |
7319 | | - key = newChild.type; |
7320 | | - if (key === REACT_FRAGMENT_TYPE) { |
| 7335 | + if ( |
| 7336 | + currentFirstChild.key === key || |
| 7337 | + currentFirstChild.key === REACT_OPTIMISTIC_KEY |
| 7338 | + ) { |
| 7339 | + var elementType = newChild.type; |
| 7340 | + if (elementType === REACT_FRAGMENT_TYPE) { |
7321 | 7341 | if (7 === currentFirstChild.tag) { |
7322 | 7342 | deleteRemainingChildren( |
7323 | 7343 | returnFiber, |
|
7327 | 7347 | currentFirstChild, |
7328 | 7348 | newChild.props.children |
7329 | 7349 | ); |
| 7350 | + lanes.key = key; |
7330 | 7351 | coerceRef(lanes, newChild); |
7331 | 7352 | lanes.return = returnFiber; |
7332 | 7353 | lanes._debugOwner = newChild._owner; |
|
7336 | 7357 | break a; |
7337 | 7358 | } |
7338 | 7359 | } else if ( |
7339 | | - currentFirstChild.elementType === key || |
| 7360 | + currentFirstChild.elementType === elementType || |
7340 | 7361 | isCompatibleFamilyForHotReloading( |
7341 | 7362 | currentFirstChild, |
7342 | 7363 | newChild |
7343 | 7364 | ) || |
7344 | | - ("object" === typeof key && |
7345 | | - null !== key && |
7346 | | - key.$$typeof === REACT_LAZY_TYPE && |
7347 | | - resolveLazy(key) === currentFirstChild.type) |
| 7365 | + ("object" === typeof elementType && |
| 7366 | + null !== elementType && |
| 7367 | + elementType.$$typeof === REACT_LAZY_TYPE && |
| 7368 | + resolveLazy(elementType) === currentFirstChild.type) |
7348 | 7369 | ) { |
7349 | 7370 | deleteRemainingChildren( |
7350 | 7371 | returnFiber, |
7351 | 7372 | currentFirstChild.sibling |
7352 | 7373 | ); |
7353 | 7374 | lanes = useFiber(currentFirstChild, newChild.props); |
| 7375 | + lanes.key = key; |
7354 | 7376 | coerceRef(lanes, newChild); |
7355 | 7377 | lanes.return = returnFiber; |
7356 | 7378 | lanes._debugOwner = newChild._owner; |
|
7392 | 7414 | return returnFiber; |
7393 | 7415 | case REACT_PORTAL_TYPE: |
7394 | 7416 | a: { |
7395 | | - prevDebugInfo = newChild; |
7396 | 7417 | for ( |
7397 | | - newChild = prevDebugInfo.key; |
| 7418 | + prevDebugInfo = newChild.key; |
7398 | 7419 | null !== currentFirstChild; |
7399 | 7420 |
|
7400 | 7421 | ) { |
7401 | | - if (currentFirstChild.key === newChild) |
| 7422 | + if ( |
| 7423 | + currentFirstChild.key === prevDebugInfo || |
| 7424 | + currentFirstChild.key === REACT_OPTIMISTIC_KEY |
| 7425 | + ) |
7402 | 7426 | if ( |
7403 | 7427 | 4 === currentFirstChild.tag && |
7404 | 7428 | currentFirstChild.stateNode.containerInfo === |
7405 | | - prevDebugInfo.containerInfo && |
| 7429 | + newChild.containerInfo && |
7406 | 7430 | currentFirstChild.stateNode.implementation === |
7407 | | - prevDebugInfo.implementation |
| 7431 | + newChild.implementation |
7408 | 7432 | ) { |
7409 | 7433 | deleteRemainingChildren( |
7410 | 7434 | returnFiber, |
7411 | 7435 | currentFirstChild.sibling |
7412 | 7436 | ); |
7413 | 7437 | lanes = useFiber( |
7414 | 7438 | currentFirstChild, |
7415 | | - prevDebugInfo.children || [] |
| 7439 | + newChild.children || [] |
7416 | 7440 | ); |
| 7441 | + lanes.key = prevDebugInfo; |
7417 | 7442 | lanes.return = returnFiber; |
7418 | 7443 | returnFiber = lanes; |
7419 | 7444 | break a; |
|
7425 | 7450 | currentFirstChild = currentFirstChild.sibling; |
7426 | 7451 | } |
7427 | 7452 | lanes = createFiberFromPortal( |
7428 | | - prevDebugInfo, |
| 7453 | + newChild, |
7429 | 7454 | returnFiber.mode, |
7430 | 7455 | lanes |
7431 | 7456 | ); |
|
7466 | 7491 | throw Error( |
7467 | 7492 | "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." |
7468 | 7493 | ); |
7469 | | - var newChildren = key.call(newChild); |
7470 | | - if (newChildren === newChild) { |
| 7494 | + elementType = key.call(newChild); |
| 7495 | + if (elementType === newChild) { |
7471 | 7496 | if ( |
7472 | 7497 | 0 !== returnFiber.tag || |
7473 | 7498 | "[object GeneratorFunction]" !== |
7474 | 7499 | Object.prototype.toString.call(returnFiber.type) || |
7475 | 7500 | "[object Generator]" !== |
7476 | | - Object.prototype.toString.call(newChildren) |
| 7501 | + Object.prototype.toString.call(elementType) |
7477 | 7502 | ) |
7478 | 7503 | didWarnAboutGenerators || |
7479 | 7504 | console.error( |
|
7490 | 7515 | returnFiber = reconcileChildrenIterator( |
7491 | 7516 | returnFiber, |
7492 | 7517 | currentFirstChild, |
7493 | | - newChildren, |
| 7518 | + elementType, |
7494 | 7519 | lanes |
7495 | 7520 | ); |
7496 | 7521 | currentDebugInfo = prevDebugInfo; |
|
28263 | 28288 | REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), |
28264 | 28289 | MAYBE_ITERATOR_SYMBOL = Symbol.iterator, |
28265 | 28290 | ASYNC_ITERATOR = Symbol.asyncIterator, |
| 28291 | + REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"), |
28266 | 28292 | REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), |
28267 | 28293 | isArrayImpl = Array.isArray, |
28268 | 28294 | ReactSharedInternals = |
@@ -32418,11 +32444,11 @@ |
32418 | 32444 | }; |
32419 | 32445 | (function () { |
32420 | 32446 | var isomorphicReactPackageVersion = React.version; |
32421 | | - if ("19.3.0-experimental-0972e239-20251118" !== isomorphicReactPackageVersion) |
| 32447 | + if ("19.3.0-experimental-eb89912e-20251118" !== isomorphicReactPackageVersion) |
32422 | 32448 | throw Error( |
32423 | 32449 | 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + |
32424 | 32450 | (isomorphicReactPackageVersion + |
32425 | | - "\n - react-dom: 19.3.0-experimental-0972e239-20251118\nLearn more: https://react.dev/warnings/version-mismatch") |
| 32451 | + "\n - react-dom: 19.3.0-experimental-eb89912e-20251118\nLearn more: https://react.dev/warnings/version-mismatch") |
32426 | 32452 | ); |
32427 | 32453 | })(); |
32428 | 32454 | ("function" === typeof Map && |
@@ -32459,10 +32485,10 @@ |
32459 | 32485 | !(function () { |
32460 | 32486 | var internals = { |
32461 | 32487 | bundleType: 1, |
32462 | | - version: "19.3.0-experimental-0972e239-20251118", |
| 32488 | + version: "19.3.0-experimental-eb89912e-20251118", |
32463 | 32489 | rendererPackageName: "react-dom", |
32464 | 32490 | currentDispatcherRef: ReactSharedInternals, |
32465 | | - reconcilerVersion: "19.3.0-experimental-0972e239-20251118" |
| 32491 | + reconcilerVersion: "19.3.0-experimental-eb89912e-20251118" |
32466 | 32492 | }; |
32467 | 32493 | internals.overrideHookState = overrideHookState; |
32468 | 32494 | internals.overrideHookStateDeletePath = overrideHookStateDeletePath; |
|
32610 | 32636 | listenToAllSupportedEvents(container); |
32611 | 32637 | return new ReactDOMHydrationRoot(initialChildren); |
32612 | 32638 | }; |
32613 | | - exports.version = "19.3.0-experimental-0972e239-20251118"; |
| 32639 | + exports.version = "19.3.0-experimental-eb89912e-20251118"; |
32614 | 32640 | "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && |
32615 | 32641 | "function" === |
32616 | 32642 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && |
|
0 commit comments