mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix: Class components should "consume" ref prop (#28719)
When a ref is passed to a class component, the class instance is
attached to the ref's current property automatically. This different
from function components, where you have to do something extra to attach
a ref to an instance, like passing the ref to `useImperativeHandle`.
Existing class component code is written with the assumption that a ref
will not be passed through as a prop. For example, class components that
act as indirections often spread `this.props` onto a child component. To
maintain this expectation, we should remove the ref from the props
object ("consume" it) before passing it to lifecycle methods. Without
this change, much existing code will break because the ref will attach
to the inner component instead of the outer one.
This is not an issue for function components because we used to warn if
you passed a ref to a function component. Instead, you had to use
`forwardRef`, which also implements this "consuming" behavior.
There are a few places in the reconciler where we modify the fiber's
internal props object before passing it to userspace. The trickiest one
is class components, because the props object gets exposed in many
different places, including as a property on the class instance.
This was already accounted for when we added support for setting default
props on a lazy wrapper (i.e. `React.lazy` that resolves to a class
component).
In all of these same places, we will also need to remove the ref prop
when `enableRefAsProp` is on.
Closes #28602
---------
Co-authored-by: Jan Kassens <jan@kassens.net>
DiffTrain build for commit https://github.com/facebook/react/commit/dc545c8d6eaca87c8d5cabfab6e1c768ecafe426.
This commit is contained in:
+124
-59
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<2cc0c2d7fd5b0cce9600b3f7552b625c>>
|
||||
* @generated SignedSource<<f5d4b17155470d32432404bc5027771b>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -12034,24 +12034,6 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var fakeInternalInstance = {};
|
||||
var didWarnAboutStateAssignmentForComponent;
|
||||
var didWarnAboutUninitializedState;
|
||||
@@ -12845,7 +12827,12 @@ if (__DEV__) {
|
||||
renderLanes
|
||||
) {
|
||||
var instance = workInProgress.stateNode;
|
||||
var oldProps = workInProgress.memoizedProps;
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context;
|
||||
var contextType = ctor.contextType;
|
||||
@@ -12868,7 +12855,13 @@ if (__DEV__) {
|
||||
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
||||
var hasNewLifecycles =
|
||||
typeof getDerivedStateFromProps === "function" ||
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // When comparing whether props changed, we should compare using the
|
||||
// unresolved props object that is stored on the fiber, rather than the
|
||||
// one that gets assigned to the instance, because that object may have been
|
||||
// cloned to resolve default props and/or remove `ref`.
|
||||
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var didReceiveNewProps = unresolvedNewProps !== unresolvedOldProps; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
// ever the previously attempted to render - not the "current". However,
|
||||
// during componentDidUpdate we pass the "current" props.
|
||||
// In order to support react-lifecycles-compat polyfilled components,
|
||||
@@ -12879,7 +12872,7 @@ if (__DEV__) {
|
||||
(typeof instance.UNSAFE_componentWillReceiveProps === "function" ||
|
||||
typeof instance.componentWillReceiveProps === "function")
|
||||
) {
|
||||
if (oldProps !== newProps || oldContext !== nextContext) {
|
||||
if (didReceiveNewProps || oldContext !== nextContext) {
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -12897,7 +12890,7 @@ if (__DEV__) {
|
||||
newState = workInProgress.memoizedState;
|
||||
|
||||
if (
|
||||
oldProps === newProps &&
|
||||
!didReceiveNewProps &&
|
||||
oldState === newState &&
|
||||
!hasContextChanged() &&
|
||||
!checkHasForceUpdateAfterProcessing()
|
||||
@@ -12994,10 +12987,11 @@ if (__DEV__) {
|
||||
var instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps =
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? unresolvedOldProps
|
||||
: resolveDefaultProps(workInProgress.type, unresolvedOldProps);
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var oldContext = instance.context;
|
||||
@@ -13166,6 +13160,53 @@ if (__DEV__) {
|
||||
return shouldUpdate;
|
||||
}
|
||||
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps, // Only resolve default props if this is a lazy component. Otherwise, they
|
||||
// would have already been resolved by the JSX runtime.
|
||||
// TODO: We're going to remove default prop resolution from the JSX runtime
|
||||
// and keep it only for class components. As part of that change, we should
|
||||
// remove this extra check.
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
|
||||
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
if (defaultProps && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (newProps[propName] === undefined) {
|
||||
newProps[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newProps;
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
// TODO: Remove support for default props for everything except class
|
||||
// components, including setting default props on a lazy wrapper around a
|
||||
// class type.
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
// If the value is an error, call this function immediately after it is thrown
|
||||
@@ -14978,10 +15019,14 @@ if (__DEV__) {
|
||||
var Component = init(payload); // Store the unwrapped component in the type.
|
||||
|
||||
workInProgress.type = Component;
|
||||
var resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
if (typeof Component === "function") {
|
||||
if (isFunctionClassComponent(Component)) {
|
||||
var resolvedProps = resolveClassComponentProps(
|
||||
Component,
|
||||
props,
|
||||
false
|
||||
);
|
||||
workInProgress.tag = ClassComponent;
|
||||
|
||||
{
|
||||
@@ -14997,6 +15042,8 @@ if (__DEV__) {
|
||||
renderLanes
|
||||
);
|
||||
} else {
|
||||
var _resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = FunctionComponent;
|
||||
|
||||
{
|
||||
@@ -15009,7 +15056,7 @@ if (__DEV__) {
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -15017,6 +15064,8 @@ if (__DEV__) {
|
||||
var $$typeof = Component.$$typeof;
|
||||
|
||||
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
||||
var _resolvedProps2 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = ForwardRef;
|
||||
|
||||
{
|
||||
@@ -15028,16 +15077,18 @@ if (__DEV__) {
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps2,
|
||||
renderLanes
|
||||
);
|
||||
} else if ($$typeof === REACT_MEMO_TYPE) {
|
||||
var _resolvedProps3 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = MemoComponent;
|
||||
return updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
|
||||
resolveDefaultProps(Component.type, _resolvedProps3), // The inner type can have defaults too
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -16943,16 +16994,17 @@ if (__DEV__) {
|
||||
var _Component = workInProgress.type;
|
||||
var _unresolvedProps = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps =
|
||||
var _resolvedProps4 = resolveClassComponentProps(
|
||||
_Component,
|
||||
_unresolvedProps,
|
||||
workInProgress.elementType === _Component
|
||||
? _unresolvedProps
|
||||
: resolveDefaultProps(_Component, _unresolvedProps);
|
||||
);
|
||||
|
||||
return updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component,
|
||||
_resolvedProps,
|
||||
_resolvedProps4,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -16984,7 +17036,7 @@ if (__DEV__) {
|
||||
var type = workInProgress.type;
|
||||
var _unresolvedProps2 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps2 =
|
||||
var _resolvedProps5 =
|
||||
workInProgress.elementType === type
|
||||
? _unresolvedProps2
|
||||
: resolveDefaultProps(type, _unresolvedProps2);
|
||||
@@ -16993,7 +17045,7 @@ if (__DEV__) {
|
||||
current,
|
||||
workInProgress,
|
||||
type,
|
||||
_resolvedProps2,
|
||||
_resolvedProps5,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -17017,14 +17069,14 @@ if (__DEV__) {
|
||||
var _type = workInProgress.type;
|
||||
var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
|
||||
|
||||
var _resolvedProps3 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
var _resolvedProps6 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
|
||||
_resolvedProps3 = resolveDefaultProps(_type.type, _resolvedProps3);
|
||||
_resolvedProps6 = resolveDefaultProps(_type.type, _resolvedProps6);
|
||||
return updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_type,
|
||||
_resolvedProps3,
|
||||
_resolvedProps6,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -17043,16 +17095,17 @@ if (__DEV__) {
|
||||
var _Component2 = workInProgress.type;
|
||||
var _unresolvedProps4 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps4 =
|
||||
var _resolvedProps7 = resolveClassComponentProps(
|
||||
_Component2,
|
||||
_unresolvedProps4,
|
||||
workInProgress.elementType === _Component2
|
||||
? _unresolvedProps4
|
||||
: resolveDefaultProps(_Component2, _unresolvedProps4);
|
||||
);
|
||||
|
||||
return mountIncompleteClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component2,
|
||||
_resolvedProps4,
|
||||
_resolvedProps7,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -17061,16 +17114,17 @@ if (__DEV__) {
|
||||
var _Component3 = workInProgress.type;
|
||||
var _unresolvedProps5 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps5 =
|
||||
var _resolvedProps8 = resolveClassComponentProps(
|
||||
_Component3,
|
||||
_unresolvedProps5,
|
||||
workInProgress.elementType === _Component3
|
||||
? _unresolvedProps5
|
||||
: resolveDefaultProps(_Component3, _unresolvedProps5);
|
||||
);
|
||||
|
||||
return mountIncompleteFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component3,
|
||||
_resolvedProps5,
|
||||
_resolvedProps8,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -18970,7 +19024,11 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = current.memoizedProps;
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
|
||||
if (shouldProfile(current)) {
|
||||
@@ -19155,7 +19213,8 @@ if (__DEV__) {
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -19183,9 +19242,11 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
var snapshot = instance.getSnapshotBeforeUpdate(
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(finishedWork.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
prevProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
|
||||
@@ -19489,7 +19550,8 @@ if (__DEV__) {
|
||||
// TODO: revisit this when we implement resuming.
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -19533,17 +19595,19 @@ if (__DEV__) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
var prevState = current.memoizedState; // We could update instance props and state here,
|
||||
// but instead we rely on them being set during last render.
|
||||
// TODO: revisit this when we implement resuming.
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -19607,7 +19671,8 @@ if (__DEV__) {
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -26737,7 +26802,7 @@ if (__DEV__) {
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "19.0.0-canary-26794664";
|
||||
var ReactVersion = "19.0.0-canary-327941b3";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
+258
-227
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<ecfcb176376bc197ec85ddd358a1c474>>
|
||||
* @generated SignedSource<<6f283bb7daebfe3367fda67f5a8a1243>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -3364,17 +3364,6 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) {
|
||||
hook.baseState = passthrough;
|
||||
return [passthrough, hook.queue.dispatch];
|
||||
};
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
function applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
ctor,
|
||||
@@ -3524,6 +3513,31 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
||||
"function" === typeof instance.componentDidMount &&
|
||||
(workInProgress.flags |= 4194308);
|
||||
}
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps,
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps;
|
||||
if ((Component = Component.defaultProps) && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
for (var propName in Component)
|
||||
void 0 === newProps[propName] &&
|
||||
(newProps[propName] = Component[propName]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
if ("object" === typeof value && null !== value) {
|
||||
@@ -4086,7 +4100,12 @@ function updateClassComponent(
|
||||
(nextProps = !0);
|
||||
else if (null === current) {
|
||||
var instance = workInProgress.stateNode,
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
unresolvedOldProps = workInProgress.memoizedProps,
|
||||
oldProps = resolveClassComponentProps(
|
||||
Component,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context,
|
||||
contextType = Component.contextType;
|
||||
@@ -4100,10 +4119,11 @@ function updateClassComponent(
|
||||
hasNewLifecycles =
|
||||
"function" === typeof getDerivedStateFromProps ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate;
|
||||
unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
|
||||
hasNewLifecycles ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== nextProps || oldContext !== contextType) &&
|
||||
((unresolvedOldProps || oldContext !== contextType) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -4116,7 +4136,7 @@ function updateClassComponent(
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
oldContext = workInProgress.memoizedState;
|
||||
oldProps !== nextProps ||
|
||||
unresolvedOldProps ||
|
||||
oldState !== oldContext ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
@@ -4163,13 +4183,14 @@ function updateClassComponent(
|
||||
instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
contextType =
|
||||
contextType = resolveClassComponentProps(
|
||||
Component,
|
||||
oldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? oldProps
|
||||
: resolveDefaultProps(workInProgress.type, oldProps);
|
||||
);
|
||||
instance.props = contextType;
|
||||
hasNewLifecycles = workInProgress.pendingProps;
|
||||
oldState = instance.context;
|
||||
unresolvedOldProps = instance.context;
|
||||
oldContext = Component.contextType;
|
||||
"object" === typeof oldContext && null !== oldContext
|
||||
? (oldContext = readContext(oldContext))
|
||||
@@ -4177,13 +4198,13 @@ function updateClassComponent(
|
||||
? previousContext
|
||||
: contextStackCursor$1.current),
|
||||
(oldContext = getMaskedContext(workInProgress, oldContext)));
|
||||
var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps;
|
||||
oldState = Component.getDerivedStateFromProps;
|
||||
(getDerivedStateFromProps =
|
||||
"function" === typeof getDerivedStateFromProps$jscomp$0 ||
|
||||
"function" === typeof oldState ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate) ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== hasNewLifecycles || oldState !== oldContext) &&
|
||||
((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -4191,20 +4212,20 @@ function updateClassComponent(
|
||||
oldContext
|
||||
));
|
||||
hasForceUpdate = !1;
|
||||
oldState = workInProgress.memoizedState;
|
||||
instance.state = oldState;
|
||||
unresolvedOldProps = workInProgress.memoizedState;
|
||||
instance.state = unresolvedOldProps;
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
var newState = workInProgress.memoizedState;
|
||||
oldProps !== hasNewLifecycles ||
|
||||
oldState !== newState ||
|
||||
unresolvedOldProps !== newState ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
? ("function" === typeof getDerivedStateFromProps$jscomp$0 &&
|
||||
? ("function" === typeof oldState &&
|
||||
(applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
Component,
|
||||
getDerivedStateFromProps$jscomp$0,
|
||||
oldState,
|
||||
nextProps
|
||||
),
|
||||
(newState = workInProgress.memoizedState)),
|
||||
@@ -4215,7 +4236,7 @@ function updateClassComponent(
|
||||
Component,
|
||||
contextType,
|
||||
nextProps,
|
||||
oldState,
|
||||
unresolvedOldProps,
|
||||
newState,
|
||||
oldContext
|
||||
) ||
|
||||
@@ -4237,11 +4258,11 @@ function updateClassComponent(
|
||||
(workInProgress.flags |= 1024))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(workInProgress.memoizedProps = nextProps),
|
||||
(workInProgress.memoizedState = newState)),
|
||||
@@ -4251,11 +4272,11 @@ function updateClassComponent(
|
||||
(nextProps = contextType))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(nextProps = !1));
|
||||
}
|
||||
@@ -4933,57 +4954,61 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
var elementType = workInProgress.elementType;
|
||||
a: {
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
|
||||
current = workInProgress.pendingProps;
|
||||
var init = elementType._init;
|
||||
elementType = init(elementType._payload);
|
||||
workInProgress.type = elementType;
|
||||
current = resolveDefaultProps(elementType, current);
|
||||
if ("function" === typeof elementType)
|
||||
shouldConstruct(elementType)
|
||||
? ((workInProgress.tag = 1),
|
||||
var props = workInProgress.pendingProps;
|
||||
current = elementType._init;
|
||||
current = current(elementType._payload);
|
||||
workInProgress.type = current;
|
||||
if ("function" === typeof current)
|
||||
shouldConstruct(current)
|
||||
? ((props = resolveClassComponentProps(current, props, !1)),
|
||||
(workInProgress.tag = 1),
|
||||
(workInProgress = updateClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)))
|
||||
: ((workInProgress.tag = 0),
|
||||
: ((props = resolveDefaultProps(current, props)),
|
||||
(workInProgress.tag = 0),
|
||||
(workInProgress = updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)));
|
||||
else {
|
||||
if (void 0 !== elementType && null !== elementType)
|
||||
if (void 0 !== current && null !== current)
|
||||
if (
|
||||
((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE)
|
||||
((elementType = current.$$typeof),
|
||||
elementType === REACT_FORWARD_REF_TYPE)
|
||||
) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 11;
|
||||
workInProgress = updateForwardRef(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
} else if (init === REACT_MEMO_TYPE) {
|
||||
} else if (elementType === REACT_MEMO_TYPE) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 14;
|
||||
workInProgress = updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
resolveDefaultProps(elementType.type, current),
|
||||
current,
|
||||
resolveDefaultProps(current.type, props),
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
}
|
||||
throw Error(
|
||||
"Element type is invalid. Received a promise that resolves to: " +
|
||||
elementType +
|
||||
current +
|
||||
". Lazy element type must resolve to a class or function."
|
||||
);
|
||||
}
|
||||
@@ -4991,33 +5016,33 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
return workInProgress;
|
||||
case 0:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
case 1:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -5026,24 +5051,24 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
if (null === current)
|
||||
throw Error("Should have a current fiber. This is a bug in React.");
|
||||
var nextProps = workInProgress.pendingProps;
|
||||
init = workInProgress.memoizedState;
|
||||
elementType = init.element;
|
||||
elementType = workInProgress.memoizedState;
|
||||
props = elementType.element;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
processUpdateQueue(workInProgress, nextProps, null, renderLanes);
|
||||
nextProps = workInProgress.memoizedState;
|
||||
var nextCache = nextProps.cache;
|
||||
pushProvider(workInProgress, CacheContext, nextCache);
|
||||
nextCache !== init.cache &&
|
||||
nextCache !== elementType.cache &&
|
||||
propagateContextChange(workInProgress, CacheContext, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
init = nextProps.element;
|
||||
init === elementType
|
||||
elementType = nextProps.element;
|
||||
elementType === props
|
||||
? (workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
current,
|
||||
workInProgress,
|
||||
renderLanes
|
||||
))
|
||||
: (reconcileChildren(current, workInProgress, init, renderLanes),
|
||||
: (reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
(workInProgress = workInProgress.child));
|
||||
return workInProgress;
|
||||
case 26:
|
||||
@@ -5051,9 +5076,9 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
case 5:
|
||||
return (
|
||||
pushHostContext(workInProgress),
|
||||
(elementType = workInProgress.pendingProps.children),
|
||||
(props = workInProgress.pendingProps.children),
|
||||
null !== workInProgress.memoizedState &&
|
||||
((init = renderWithHooks(
|
||||
((elementType = renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
@@ -5061,17 +5086,17 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
null,
|
||||
renderLanes
|
||||
)),
|
||||
(HostTransitionContext._currentValue2 = init),
|
||||
(HostTransitionContext._currentValue2 = elementType),
|
||||
didReceiveUpdate &&
|
||||
null !== current &&
|
||||
current.memoizedState.memoizedState !== init &&
|
||||
current.memoizedState.memoizedState !== elementType &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
renderLanes
|
||||
)),
|
||||
markRef(current, workInProgress),
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 6:
|
||||
@@ -5084,35 +5109,30 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
workInProgress,
|
||||
workInProgress.stateNode.containerInfo
|
||||
),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(props = workInProgress.pendingProps),
|
||||
null === current
|
||||
? (workInProgress.child = reconcileChildFibers(
|
||||
workInProgress,
|
||||
null,
|
||||
elementType,
|
||||
props,
|
||||
renderLanes
|
||||
))
|
||||
: reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType,
|
||||
renderLanes
|
||||
),
|
||||
: reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 11:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateForwardRef(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -5148,15 +5168,15 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 10:
|
||||
a: {
|
||||
elementType = workInProgress.type._context;
|
||||
init = workInProgress.pendingProps;
|
||||
props = workInProgress.type._context;
|
||||
elementType = workInProgress.pendingProps;
|
||||
nextProps = workInProgress.memoizedProps;
|
||||
nextCache = init.value;
|
||||
pushProvider(workInProgress, elementType, nextCache);
|
||||
nextCache = elementType.value;
|
||||
pushProvider(workInProgress, props, nextCache);
|
||||
if (null !== nextProps)
|
||||
if (objectIs(nextProps.value, nextCache)) {
|
||||
if (
|
||||
nextProps.children === init.children &&
|
||||
nextProps.children === elementType.children &&
|
||||
!didPerformWorkStackCursor.current
|
||||
) {
|
||||
workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
@@ -5166,33 +5186,37 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
break a;
|
||||
}
|
||||
} else
|
||||
propagateContextChange(workInProgress, elementType, renderLanes);
|
||||
reconcileChildren(current, workInProgress, init.children, renderLanes);
|
||||
} else propagateContextChange(workInProgress, props, renderLanes);
|
||||
reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType.children,
|
||||
renderLanes
|
||||
);
|
||||
workInProgress = workInProgress.child;
|
||||
}
|
||||
return workInProgress;
|
||||
case 9:
|
||||
return (
|
||||
(init = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps.children),
|
||||
(elementType = workInProgress.type),
|
||||
(props = workInProgress.pendingProps.children),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(init = readContext(init)),
|
||||
(elementType = elementType(init)),
|
||||
(elementType = readContext(elementType)),
|
||||
(props = props(elementType)),
|
||||
(workInProgress.flags |= 1),
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 14:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = resolveDefaultProps(elementType, workInProgress.pendingProps)),
|
||||
(init = resolveDefaultProps(elementType.type, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveDefaultProps(props, workInProgress.pendingProps)),
|
||||
(elementType = resolveDefaultProps(props.type, elementType)),
|
||||
updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -5206,24 +5230,24 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 17:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 1),
|
||||
isContextProvider(elementType)
|
||||
isContextProvider(props)
|
||||
? ((current = !0), pushContextProvider(workInProgress))
|
||||
: (current = !1),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
constructClassInstance(workInProgress, elementType, init),
|
||||
mountClassInstance(workInProgress, elementType, init, renderLanes),
|
||||
constructClassInstance(workInProgress, props, elementType),
|
||||
mountClassInstance(workInProgress, props, elementType, renderLanes),
|
||||
finishClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
props,
|
||||
!0,
|
||||
current,
|
||||
renderLanes
|
||||
@@ -5231,19 +5255,19 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 28:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 0),
|
||||
updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -5254,39 +5278,40 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
case 24:
|
||||
return (
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(elementType = readContext(CacheContext)),
|
||||
(props = readContext(CacheContext)),
|
||||
null === current
|
||||
? ((init = peekCacheFromPool()),
|
||||
null === init &&
|
||||
((init = workInProgressRoot),
|
||||
? ((elementType = peekCacheFromPool()),
|
||||
null === elementType &&
|
||||
((elementType = workInProgressRoot),
|
||||
(nextProps = createCache()),
|
||||
(init.pooledCache = nextProps),
|
||||
(elementType.pooledCache = nextProps),
|
||||
nextProps.refCount++,
|
||||
null !== nextProps && (init.pooledCacheLanes |= renderLanes),
|
||||
(init = nextProps)),
|
||||
null !== nextProps &&
|
||||
(elementType.pooledCacheLanes |= renderLanes),
|
||||
(elementType = nextProps)),
|
||||
(workInProgress.memoizedState = {
|
||||
parent: elementType,
|
||||
cache: init
|
||||
parent: props,
|
||||
cache: elementType
|
||||
}),
|
||||
initializeUpdateQueue(workInProgress),
|
||||
pushProvider(workInProgress, CacheContext, init))
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: (0 !== (current.lanes & renderLanes) &&
|
||||
(cloneUpdateQueue(current, workInProgress),
|
||||
processUpdateQueue(workInProgress, null, null, renderLanes),
|
||||
suspendIfUpdateReadFromEntangledAsyncAction()),
|
||||
(init = current.memoizedState),
|
||||
(elementType = current.memoizedState),
|
||||
(nextProps = workInProgress.memoizedState),
|
||||
init.parent !== elementType
|
||||
? ((init = { parent: elementType, cache: elementType }),
|
||||
(workInProgress.memoizedState = init),
|
||||
elementType.parent !== props
|
||||
? ((elementType = { parent: props, cache: props }),
|
||||
(workInProgress.memoizedState = elementType),
|
||||
0 === workInProgress.lanes &&
|
||||
(workInProgress.memoizedState =
|
||||
workInProgress.updateQueue.baseState =
|
||||
init),
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: ((elementType = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, elementType),
|
||||
elementType !== init.cache &&
|
||||
elementType),
|
||||
pushProvider(workInProgress, CacheContext, props))
|
||||
: ((props = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, props),
|
||||
props !== elementType.cache &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
CacheContext,
|
||||
@@ -5535,14 +5560,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$67 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$67 = lastTailNode),
|
||||
for (var lastTailNode$70 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$70 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$67
|
||||
null === lastTailNode$70
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$67.sibling = null);
|
||||
: (lastTailNode$70.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -5552,19 +5577,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$68 = completedWork.child; null !== child$68; )
|
||||
(newChildLanes |= child$68.lanes | child$68.childLanes),
|
||||
(subtreeFlags |= child$68.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$68.flags & 31457280),
|
||||
(child$68.return = completedWork),
|
||||
(child$68 = child$68.sibling);
|
||||
for (var child$71 = completedWork.child; null !== child$71; )
|
||||
(newChildLanes |= child$71.lanes | child$71.childLanes),
|
||||
(subtreeFlags |= child$71.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$71.flags & 31457280),
|
||||
(child$71.return = completedWork),
|
||||
(child$71 = child$71.sibling);
|
||||
else
|
||||
for (child$68 = completedWork.child; null !== child$68; )
|
||||
(newChildLanes |= child$68.lanes | child$68.childLanes),
|
||||
(subtreeFlags |= child$68.subtreeFlags),
|
||||
(subtreeFlags |= child$68.flags),
|
||||
(child$68.return = completedWork),
|
||||
(child$68 = child$68.sibling);
|
||||
for (child$71 = completedWork.child; null !== child$71; )
|
||||
(newChildLanes |= child$71.lanes | child$71.childLanes),
|
||||
(subtreeFlags |= child$71.subtreeFlags),
|
||||
(subtreeFlags |= child$71.flags),
|
||||
(child$71.return = completedWork),
|
||||
(child$71 = child$71.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -5727,11 +5752,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
null !== newProps.alternate.memoizedState &&
|
||||
null !== newProps.alternate.memoizedState.cachePool &&
|
||||
(index = newProps.alternate.memoizedState.cachePool.pool);
|
||||
var cache$72 = null;
|
||||
var cache$75 = null;
|
||||
null !== newProps.memoizedState &&
|
||||
null !== newProps.memoizedState.cachePool &&
|
||||
(cache$72 = newProps.memoizedState.cachePool.pool);
|
||||
cache$72 !== index && (newProps.flags |= 2048);
|
||||
(cache$75 = newProps.memoizedState.cachePool.pool);
|
||||
cache$75 !== index && (newProps.flags |= 2048);
|
||||
}
|
||||
renderLanes !== current &&
|
||||
renderLanes &&
|
||||
@@ -5758,8 +5783,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
index = workInProgress.memoizedState;
|
||||
if (null === index) return bubbleProperties(workInProgress), null;
|
||||
newProps = 0 !== (workInProgress.flags & 128);
|
||||
cache$72 = index.rendering;
|
||||
if (null === cache$72)
|
||||
cache$75 = index.rendering;
|
||||
if (null === cache$75)
|
||||
if (newProps) cutOffTailIfNeeded(index, !1);
|
||||
else {
|
||||
if (
|
||||
@@ -5767,11 +5792,11 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
(null !== current && 0 !== (current.flags & 128))
|
||||
)
|
||||
for (current = workInProgress.child; null !== current; ) {
|
||||
cache$72 = findFirstSuspended(current);
|
||||
if (null !== cache$72) {
|
||||
cache$75 = findFirstSuspended(current);
|
||||
if (null !== cache$75) {
|
||||
workInProgress.flags |= 128;
|
||||
cutOffTailIfNeeded(index, !1);
|
||||
current = cache$72.updateQueue;
|
||||
current = cache$75.updateQueue;
|
||||
workInProgress.updateQueue = current;
|
||||
scheduleRetryEffect(workInProgress, current);
|
||||
workInProgress.subtreeFlags = 0;
|
||||
@@ -5796,7 +5821,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}
|
||||
else {
|
||||
if (!newProps)
|
||||
if (((current = findFirstSuspended(cache$72)), null !== current)) {
|
||||
if (((current = findFirstSuspended(cache$75)), null !== current)) {
|
||||
if (
|
||||
((workInProgress.flags |= 128),
|
||||
(newProps = !0),
|
||||
@@ -5806,7 +5831,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(index, !0),
|
||||
null === index.tail &&
|
||||
"hidden" === index.tailMode &&
|
||||
!cache$72.alternate)
|
||||
!cache$75.alternate)
|
||||
)
|
||||
return bubbleProperties(workInProgress), null;
|
||||
} else
|
||||
@@ -5818,13 +5843,13 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
cutOffTailIfNeeded(index, !1),
|
||||
(workInProgress.lanes = 4194304));
|
||||
index.isBackwards
|
||||
? ((cache$72.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$72))
|
||||
? ((cache$75.sibling = workInProgress.child),
|
||||
(workInProgress.child = cache$75))
|
||||
: ((current = index.last),
|
||||
null !== current
|
||||
? (current.sibling = cache$72)
|
||||
: (workInProgress.child = cache$72),
|
||||
(index.last = cache$72));
|
||||
? (current.sibling = cache$75)
|
||||
: (workInProgress.child = cache$75),
|
||||
(index.last = cache$75));
|
||||
}
|
||||
if (null !== index.tail)
|
||||
return (
|
||||
@@ -5998,6 +6023,15 @@ var offscreenSubtreeIsHidden = !1,
|
||||
offscreenSubtreeWasHidden = !1,
|
||||
PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
|
||||
nextEffect = null;
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
}
|
||||
function safelyAttachRef(current, nearestMountedAncestor) {
|
||||
try {
|
||||
var ref = current.ref;
|
||||
@@ -6037,8 +6071,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$88) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$88);
|
||||
} catch (error$91) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$91);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -6072,13 +6106,14 @@ function commitBeforeMutationEffects(root, firstChild) {
|
||||
break;
|
||||
case 1:
|
||||
if (0 !== (flags & 1024) && null !== current) {
|
||||
var prevProps = current.memoizedProps,
|
||||
prevState = current.memoizedState,
|
||||
var prevState = current.memoizedState,
|
||||
instance = root.stateNode,
|
||||
snapshot = instance.getSnapshotBeforeUpdate(
|
||||
root.elementType === root.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(root.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
root.type,
|
||||
current.memoizedProps,
|
||||
root.elementType === root.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
||||
@@ -6144,10 +6179,10 @@ function commitHookEffectListMount(flags, finishedWork) {
|
||||
var effect = (finishedWork = finishedWork.next);
|
||||
do {
|
||||
if ((effect.tag & flags) === flags) {
|
||||
var create$89 = effect.create,
|
||||
var create$92 = effect.create,
|
||||
inst = effect.inst;
|
||||
create$89 = create$89();
|
||||
inst.destroy = create$89;
|
||||
create$92 = create$92();
|
||||
inst.destroy = create$92;
|
||||
}
|
||||
effect = effect.next;
|
||||
} while (effect !== finishedWork);
|
||||
@@ -6190,10 +6225,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
current = current.memoizedState;
|
||||
try {
|
||||
finishedRoot.componentDidUpdate(
|
||||
@@ -6201,11 +6237,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$90) {
|
||||
} catch (error$93) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$90
|
||||
error$93
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -6444,9 +6480,7 @@ function commitDeletionEffectsOnFiber(
|
||||
"function" === typeof prevHostParent.componentWillUnmount)
|
||||
)
|
||||
try {
|
||||
(prevHostParent.props = deletedFiber.memoizedProps),
|
||||
(prevHostParent.state = deletedFiber.memoizedState),
|
||||
prevHostParent.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(deletedFiber, prevHostParent);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -6582,8 +6616,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$98) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$98);
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$101);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -6621,8 +6655,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
finishedWork.updateQueue = null;
|
||||
try {
|
||||
(flags.type = type), (flags.props = existingHiddenCallbacks);
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$101);
|
||||
} catch (error$104) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$104);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -6638,8 +6672,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
existingHiddenCallbacks = finishedWork.memoizedProps;
|
||||
try {
|
||||
flags.text = existingHiddenCallbacks;
|
||||
} catch (error$102) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$102);
|
||||
} catch (error$105) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -6725,11 +6759,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
wasHidden.stateNode.isHidden = existingHiddenCallbacks
|
||||
? !0
|
||||
: !1;
|
||||
} catch (error$92) {
|
||||
} catch (error$95) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$92
|
||||
error$95
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
@@ -6807,12 +6841,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$93 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$94 = getHostSibling(finishedWork);
|
||||
var parent$96 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$97 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$94,
|
||||
parent$93
|
||||
before$97,
|
||||
parent$96
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -6851,10 +6885,7 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
|
||||
var current = finishedWork,
|
||||
nearestMountedAncestor = finishedWork.return;
|
||||
try {
|
||||
var current$jscomp$0 = current;
|
||||
instance.props = current$jscomp$0.memoizedProps;
|
||||
instance.state = current$jscomp$0.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(current, instance);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -7944,8 +7975,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$110) {
|
||||
handleThrow(root, thrownValue$110);
|
||||
} catch (thrownValue$113) {
|
||||
handleThrow(root, thrownValue$113);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -8053,8 +8084,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$112) {
|
||||
handleThrow(root, thrownValue$112);
|
||||
} catch (thrownValue$115) {
|
||||
handleThrow(root, thrownValue$115);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -9186,19 +9217,19 @@ function wrapFiber(fiber) {
|
||||
fiberToWrapper.set(fiber, wrapper));
|
||||
return wrapper;
|
||||
}
|
||||
var devToolsConfig$jscomp$inline_990 = {
|
||||
var devToolsConfig$jscomp$inline_999 = {
|
||||
findFiberByHostInstance: function () {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "19.0.0-canary-e5758235",
|
||||
version: "19.0.0-canary-13b2df5c",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1175 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_990.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_990.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_990.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_990.rendererConfig,
|
||||
var internals$jscomp$inline_1183 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_999.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_999.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_999.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_999.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -9215,26 +9246,26 @@ var internals$jscomp$inline_1175 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_990.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_999.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-canary-e5758235"
|
||||
reconcilerVersion: "19.0.0-canary-13b2df5c"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1176 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1184 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1176.isDisabled &&
|
||||
hook$jscomp$inline_1176.supportsFiber
|
||||
!hook$jscomp$inline_1184.isDisabled &&
|
||||
hook$jscomp$inline_1184.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1176.inject(
|
||||
internals$jscomp$inline_1175
|
||||
(rendererID = hook$jscomp$inline_1184.inject(
|
||||
internals$jscomp$inline_1183
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1176);
|
||||
(injectedHook = hook$jscomp$inline_1184);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports._Scheduler = Scheduler;
|
||||
|
||||
+282
-246
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1 +1 @@
|
||||
5de8703646cdd3838cb1686f761b10c0692743aa
|
||||
dc545c8d6eaca87c8d5cabfab6e1c768ecafe426
|
||||
|
||||
+124
-59
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<de09692772b5298e95498cd519b416ad>>
|
||||
* @generated SignedSource<<e080fbb126dafba7029763f501cd84ef>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -15640,24 +15640,6 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var fakeInternalInstance = {};
|
||||
var didWarnAboutStateAssignmentForComponent;
|
||||
var didWarnAboutUninitializedState;
|
||||
@@ -16489,7 +16471,12 @@ to return true:wantsResponderID| |
|
||||
renderLanes
|
||||
) {
|
||||
var instance = workInProgress.stateNode;
|
||||
var oldProps = workInProgress.memoizedProps;
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context;
|
||||
var contextType = ctor.contextType;
|
||||
@@ -16512,7 +16499,13 @@ to return true:wantsResponderID| |
|
||||
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
||||
var hasNewLifecycles =
|
||||
typeof getDerivedStateFromProps === "function" ||
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // When comparing whether props changed, we should compare using the
|
||||
// unresolved props object that is stored on the fiber, rather than the
|
||||
// one that gets assigned to the instance, because that object may have been
|
||||
// cloned to resolve default props and/or remove `ref`.
|
||||
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var didReceiveNewProps = unresolvedNewProps !== unresolvedOldProps; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
// ever the previously attempted to render - not the "current". However,
|
||||
// during componentDidUpdate we pass the "current" props.
|
||||
// In order to support react-lifecycles-compat polyfilled components,
|
||||
@@ -16523,7 +16516,7 @@ to return true:wantsResponderID| |
|
||||
(typeof instance.UNSAFE_componentWillReceiveProps === "function" ||
|
||||
typeof instance.componentWillReceiveProps === "function")
|
||||
) {
|
||||
if (oldProps !== newProps || oldContext !== nextContext) {
|
||||
if (didReceiveNewProps || oldContext !== nextContext) {
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -16541,7 +16534,7 @@ to return true:wantsResponderID| |
|
||||
newState = workInProgress.memoizedState;
|
||||
|
||||
if (
|
||||
oldProps === newProps &&
|
||||
!didReceiveNewProps &&
|
||||
oldState === newState &&
|
||||
!hasContextChanged() &&
|
||||
!checkHasForceUpdateAfterProcessing()
|
||||
@@ -16638,10 +16631,11 @@ to return true:wantsResponderID| |
|
||||
var instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps =
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? unresolvedOldProps
|
||||
: resolveDefaultProps(workInProgress.type, unresolvedOldProps);
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var oldContext = instance.context;
|
||||
@@ -16810,6 +16804,53 @@ to return true:wantsResponderID| |
|
||||
return shouldUpdate;
|
||||
}
|
||||
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps, // Only resolve default props if this is a lazy component. Otherwise, they
|
||||
// would have already been resolved by the JSX runtime.
|
||||
// TODO: We're going to remove default prop resolution from the JSX runtime
|
||||
// and keep it only for class components. As part of that change, we should
|
||||
// remove this extra check.
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
|
||||
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
if (defaultProps && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (newProps[propName] === undefined) {
|
||||
newProps[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newProps;
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
// TODO: Remove support for default props for everything except class
|
||||
// components, including setting default props on a lazy wrapper around a
|
||||
// class type.
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
// If the value is an error, call this function immediately after it is thrown
|
||||
@@ -18639,10 +18680,14 @@ to return true:wantsResponderID| |
|
||||
var Component = init(payload); // Store the unwrapped component in the type.
|
||||
|
||||
workInProgress.type = Component;
|
||||
var resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
if (typeof Component === "function") {
|
||||
if (isFunctionClassComponent(Component)) {
|
||||
var resolvedProps = resolveClassComponentProps(
|
||||
Component,
|
||||
props,
|
||||
false
|
||||
);
|
||||
workInProgress.tag = ClassComponent;
|
||||
|
||||
{
|
||||
@@ -18658,6 +18703,8 @@ to return true:wantsResponderID| |
|
||||
renderLanes
|
||||
);
|
||||
} else {
|
||||
var _resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = FunctionComponent;
|
||||
|
||||
{
|
||||
@@ -18670,7 +18717,7 @@ to return true:wantsResponderID| |
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -18678,6 +18725,8 @@ to return true:wantsResponderID| |
|
||||
var $$typeof = Component.$$typeof;
|
||||
|
||||
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
||||
var _resolvedProps2 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = ForwardRef;
|
||||
|
||||
{
|
||||
@@ -18689,16 +18738,18 @@ to return true:wantsResponderID| |
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps2,
|
||||
renderLanes
|
||||
);
|
||||
} else if ($$typeof === REACT_MEMO_TYPE) {
|
||||
var _resolvedProps3 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = MemoComponent;
|
||||
return updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
|
||||
resolveDefaultProps(Component.type, _resolvedProps3), // The inner type can have defaults too
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20611,16 +20662,17 @@ to return true:wantsResponderID| |
|
||||
var _Component = workInProgress.type;
|
||||
var _unresolvedProps = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps =
|
||||
var _resolvedProps4 = resolveClassComponentProps(
|
||||
_Component,
|
||||
_unresolvedProps,
|
||||
workInProgress.elementType === _Component
|
||||
? _unresolvedProps
|
||||
: resolveDefaultProps(_Component, _unresolvedProps);
|
||||
);
|
||||
|
||||
return updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component,
|
||||
_resolvedProps,
|
||||
_resolvedProps4,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20652,7 +20704,7 @@ to return true:wantsResponderID| |
|
||||
var type = workInProgress.type;
|
||||
var _unresolvedProps2 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps2 =
|
||||
var _resolvedProps5 =
|
||||
workInProgress.elementType === type
|
||||
? _unresolvedProps2
|
||||
: resolveDefaultProps(type, _unresolvedProps2);
|
||||
@@ -20661,7 +20713,7 @@ to return true:wantsResponderID| |
|
||||
current,
|
||||
workInProgress,
|
||||
type,
|
||||
_resolvedProps2,
|
||||
_resolvedProps5,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20685,14 +20737,14 @@ to return true:wantsResponderID| |
|
||||
var _type = workInProgress.type;
|
||||
var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
|
||||
|
||||
var _resolvedProps3 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
var _resolvedProps6 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
|
||||
_resolvedProps3 = resolveDefaultProps(_type.type, _resolvedProps3);
|
||||
_resolvedProps6 = resolveDefaultProps(_type.type, _resolvedProps6);
|
||||
return updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_type,
|
||||
_resolvedProps3,
|
||||
_resolvedProps6,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20711,16 +20763,17 @@ to return true:wantsResponderID| |
|
||||
var _Component2 = workInProgress.type;
|
||||
var _unresolvedProps4 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps4 =
|
||||
var _resolvedProps7 = resolveClassComponentProps(
|
||||
_Component2,
|
||||
_unresolvedProps4,
|
||||
workInProgress.elementType === _Component2
|
||||
? _unresolvedProps4
|
||||
: resolveDefaultProps(_Component2, _unresolvedProps4);
|
||||
);
|
||||
|
||||
return mountIncompleteClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component2,
|
||||
_resolvedProps4,
|
||||
_resolvedProps7,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20729,16 +20782,17 @@ to return true:wantsResponderID| |
|
||||
var _Component3 = workInProgress.type;
|
||||
var _unresolvedProps5 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps5 =
|
||||
var _resolvedProps8 = resolveClassComponentProps(
|
||||
_Component3,
|
||||
_unresolvedProps5,
|
||||
workInProgress.elementType === _Component3
|
||||
? _unresolvedProps5
|
||||
: resolveDefaultProps(_Component3, _unresolvedProps5);
|
||||
);
|
||||
|
||||
return mountIncompleteFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component3,
|
||||
_resolvedProps5,
|
||||
_resolvedProps8,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -22887,7 +22941,11 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = current.memoizedProps;
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
|
||||
if (shouldProfile(current)) {
|
||||
@@ -23072,7 +23130,8 @@ to return true:wantsResponderID| |
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23100,9 +23159,11 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
|
||||
var snapshot = instance.getSnapshotBeforeUpdate(
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(finishedWork.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
prevProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
|
||||
@@ -23399,7 +23460,8 @@ to return true:wantsResponderID| |
|
||||
// TODO: revisit this when we implement resuming.
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23443,17 +23505,19 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
var prevState = current.memoizedState; // We could update instance props and state here,
|
||||
// but instead we rely on them being set during last render.
|
||||
// TODO: revisit this when we implement resuming.
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23517,7 +23581,8 @@ to return true:wantsResponderID| |
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -30508,7 +30573,7 @@ to return true:wantsResponderID| |
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "19.0.0-canary-e3d5c900";
|
||||
var ReactVersion = "19.0.0-canary-81190b3e";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
+250
-219
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<1c4989a9b48d58086b7232d24f7f3aaa>>
|
||||
* @generated SignedSource<<23f2356ead4c48c2d682dd38827bd844>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([
|
||||
"ReactNativeBridgeEventPlugin"
|
||||
]);
|
||||
recomputePluginOrdering();
|
||||
var injectedNamesToPlugins$jscomp$inline_248 = {
|
||||
var injectedNamesToPlugins$jscomp$inline_251 = {
|
||||
ResponderEventPlugin: ResponderEventPlugin,
|
||||
ReactNativeBridgeEventPlugin: {
|
||||
eventTypes: {},
|
||||
@@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_248 = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isOrderingDirty$jscomp$inline_249 = !1,
|
||||
pluginName$jscomp$inline_250;
|
||||
for (pluginName$jscomp$inline_250 in injectedNamesToPlugins$jscomp$inline_248)
|
||||
isOrderingDirty$jscomp$inline_252 = !1,
|
||||
pluginName$jscomp$inline_253;
|
||||
for (pluginName$jscomp$inline_253 in injectedNamesToPlugins$jscomp$inline_251)
|
||||
if (
|
||||
injectedNamesToPlugins$jscomp$inline_248.hasOwnProperty(
|
||||
pluginName$jscomp$inline_250
|
||||
injectedNamesToPlugins$jscomp$inline_251.hasOwnProperty(
|
||||
pluginName$jscomp$inline_253
|
||||
)
|
||||
) {
|
||||
var pluginModule$jscomp$inline_251 =
|
||||
injectedNamesToPlugins$jscomp$inline_248[pluginName$jscomp$inline_250];
|
||||
var pluginModule$jscomp$inline_254 =
|
||||
injectedNamesToPlugins$jscomp$inline_251[pluginName$jscomp$inline_253];
|
||||
if (
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_250) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_250] !==
|
||||
pluginModule$jscomp$inline_251
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_253) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_253] !==
|
||||
pluginModule$jscomp$inline_254
|
||||
) {
|
||||
if (namesToPlugins[pluginName$jscomp$inline_250])
|
||||
if (namesToPlugins[pluginName$jscomp$inline_253])
|
||||
throw Error(
|
||||
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
|
||||
(pluginName$jscomp$inline_250 + "`.")
|
||||
(pluginName$jscomp$inline_253 + "`.")
|
||||
);
|
||||
namesToPlugins[pluginName$jscomp$inline_250] =
|
||||
pluginModule$jscomp$inline_251;
|
||||
isOrderingDirty$jscomp$inline_249 = !0;
|
||||
namesToPlugins[pluginName$jscomp$inline_253] =
|
||||
pluginModule$jscomp$inline_254;
|
||||
isOrderingDirty$jscomp$inline_252 = !0;
|
||||
}
|
||||
}
|
||||
isOrderingDirty$jscomp$inline_249 && recomputePluginOrdering();
|
||||
isOrderingDirty$jscomp$inline_252 && recomputePluginOrdering();
|
||||
var emptyObject$1 = {},
|
||||
removedKeys = null,
|
||||
removedKeyCount = 0,
|
||||
@@ -4917,17 +4917,6 @@ enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useActionState = rerenderActionState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
function applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
ctor,
|
||||
@@ -5077,6 +5066,31 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
||||
"function" === typeof instance.componentDidMount &&
|
||||
(workInProgress.flags |= 4194308);
|
||||
}
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps,
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps;
|
||||
if ((Component = Component.defaultProps) && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
for (var propName in Component)
|
||||
void 0 === newProps[propName] &&
|
||||
(newProps[propName] = Component[propName]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
if ("object" === typeof value && null !== value) {
|
||||
@@ -5633,7 +5647,12 @@ function updateClassComponent(
|
||||
(nextProps = !0);
|
||||
else if (null === current) {
|
||||
var instance = workInProgress.stateNode,
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
unresolvedOldProps = workInProgress.memoizedProps,
|
||||
oldProps = resolveClassComponentProps(
|
||||
Component,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context,
|
||||
contextType = Component.contextType;
|
||||
@@ -5647,10 +5666,11 @@ function updateClassComponent(
|
||||
hasNewLifecycles =
|
||||
"function" === typeof getDerivedStateFromProps ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate;
|
||||
unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
|
||||
hasNewLifecycles ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== nextProps || oldContext !== contextType) &&
|
||||
((unresolvedOldProps || oldContext !== contextType) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -5663,7 +5683,7 @@ function updateClassComponent(
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
oldContext = workInProgress.memoizedState;
|
||||
oldProps !== nextProps ||
|
||||
unresolvedOldProps ||
|
||||
oldState !== oldContext ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
@@ -5710,13 +5730,14 @@ function updateClassComponent(
|
||||
instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
contextType =
|
||||
contextType = resolveClassComponentProps(
|
||||
Component,
|
||||
oldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? oldProps
|
||||
: resolveDefaultProps(workInProgress.type, oldProps);
|
||||
);
|
||||
instance.props = contextType;
|
||||
hasNewLifecycles = workInProgress.pendingProps;
|
||||
oldState = instance.context;
|
||||
unresolvedOldProps = instance.context;
|
||||
oldContext = Component.contextType;
|
||||
"object" === typeof oldContext && null !== oldContext
|
||||
? (oldContext = readContext(oldContext))
|
||||
@@ -5724,13 +5745,13 @@ function updateClassComponent(
|
||||
? previousContext
|
||||
: contextStackCursor$1.current),
|
||||
(oldContext = getMaskedContext(workInProgress, oldContext)));
|
||||
var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps;
|
||||
oldState = Component.getDerivedStateFromProps;
|
||||
(getDerivedStateFromProps =
|
||||
"function" === typeof getDerivedStateFromProps$jscomp$0 ||
|
||||
"function" === typeof oldState ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate) ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== hasNewLifecycles || oldState !== oldContext) &&
|
||||
((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -5738,20 +5759,20 @@ function updateClassComponent(
|
||||
oldContext
|
||||
));
|
||||
hasForceUpdate = !1;
|
||||
oldState = workInProgress.memoizedState;
|
||||
instance.state = oldState;
|
||||
unresolvedOldProps = workInProgress.memoizedState;
|
||||
instance.state = unresolvedOldProps;
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
var newState = workInProgress.memoizedState;
|
||||
oldProps !== hasNewLifecycles ||
|
||||
oldState !== newState ||
|
||||
unresolvedOldProps !== newState ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
? ("function" === typeof getDerivedStateFromProps$jscomp$0 &&
|
||||
? ("function" === typeof oldState &&
|
||||
(applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
Component,
|
||||
getDerivedStateFromProps$jscomp$0,
|
||||
oldState,
|
||||
nextProps
|
||||
),
|
||||
(newState = workInProgress.memoizedState)),
|
||||
@@ -5762,7 +5783,7 @@ function updateClassComponent(
|
||||
Component,
|
||||
contextType,
|
||||
nextProps,
|
||||
oldState,
|
||||
unresolvedOldProps,
|
||||
newState,
|
||||
oldContext
|
||||
) ||
|
||||
@@ -5784,11 +5805,11 @@ function updateClassComponent(
|
||||
(workInProgress.flags |= 1024))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(workInProgress.memoizedProps = nextProps),
|
||||
(workInProgress.memoizedState = newState)),
|
||||
@@ -5798,11 +5819,11 @@ function updateClassComponent(
|
||||
(nextProps = contextType))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(nextProps = !1));
|
||||
}
|
||||
@@ -6483,57 +6504,61 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
var elementType = workInProgress.elementType;
|
||||
a: {
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
|
||||
current = workInProgress.pendingProps;
|
||||
var init = elementType._init;
|
||||
elementType = init(elementType._payload);
|
||||
workInProgress.type = elementType;
|
||||
current = resolveDefaultProps(elementType, current);
|
||||
if ("function" === typeof elementType)
|
||||
shouldConstruct(elementType)
|
||||
? ((workInProgress.tag = 1),
|
||||
var props = workInProgress.pendingProps;
|
||||
current = elementType._init;
|
||||
current = current(elementType._payload);
|
||||
workInProgress.type = current;
|
||||
if ("function" === typeof current)
|
||||
shouldConstruct(current)
|
||||
? ((props = resolveClassComponentProps(current, props, !1)),
|
||||
(workInProgress.tag = 1),
|
||||
(workInProgress = updateClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)))
|
||||
: ((workInProgress.tag = 0),
|
||||
: ((props = resolveDefaultProps(current, props)),
|
||||
(workInProgress.tag = 0),
|
||||
(workInProgress = updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)));
|
||||
else {
|
||||
if (void 0 !== elementType && null !== elementType)
|
||||
if (void 0 !== current && null !== current)
|
||||
if (
|
||||
((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE)
|
||||
((elementType = current.$$typeof),
|
||||
elementType === REACT_FORWARD_REF_TYPE)
|
||||
) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 11;
|
||||
workInProgress = updateForwardRef(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
} else if (init === REACT_MEMO_TYPE) {
|
||||
} else if (elementType === REACT_MEMO_TYPE) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 14;
|
||||
workInProgress = updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
resolveDefaultProps(elementType.type, current),
|
||||
current,
|
||||
resolveDefaultProps(current.type, props),
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
}
|
||||
throw Error(
|
||||
"Element type is invalid. Received a promise that resolves to: " +
|
||||
elementType +
|
||||
current +
|
||||
". Lazy element type must resolve to a class or function."
|
||||
);
|
||||
}
|
||||
@@ -6541,33 +6566,33 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
return workInProgress;
|
||||
case 0:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
case 1:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6576,34 +6601,34 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
if (null === current)
|
||||
throw Error("Should have a current fiber. This is a bug in React.");
|
||||
var nextProps = workInProgress.pendingProps;
|
||||
init = workInProgress.memoizedState;
|
||||
elementType = init.element;
|
||||
elementType = workInProgress.memoizedState;
|
||||
props = elementType.element;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
processUpdateQueue(workInProgress, nextProps, null, renderLanes);
|
||||
nextProps = workInProgress.memoizedState;
|
||||
var nextCache = nextProps.cache;
|
||||
pushProvider(workInProgress, CacheContext, nextCache);
|
||||
nextCache !== init.cache &&
|
||||
nextCache !== elementType.cache &&
|
||||
propagateContextChange(workInProgress, CacheContext, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
init = nextProps.element;
|
||||
init === elementType
|
||||
elementType = nextProps.element;
|
||||
elementType === props
|
||||
? (workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
current,
|
||||
workInProgress,
|
||||
renderLanes
|
||||
))
|
||||
: (reconcileChildren(current, workInProgress, init, renderLanes),
|
||||
: (reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
(workInProgress = workInProgress.child));
|
||||
return workInProgress;
|
||||
case 26:
|
||||
case 27:
|
||||
case 5:
|
||||
pushHostContext(workInProgress);
|
||||
elementType = workInProgress.pendingProps.children;
|
||||
props = workInProgress.pendingProps.children;
|
||||
if (enableAsyncActions && null !== workInProgress.memoizedState) {
|
||||
if (!enableAsyncActions) throw Error("Not implemented.");
|
||||
init = renderWithHooks(
|
||||
elementType = renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
@@ -6611,10 +6636,10 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
null,
|
||||
renderLanes
|
||||
);
|
||||
HostTransitionContext._currentValue2 = init;
|
||||
HostTransitionContext._currentValue2 = elementType;
|
||||
didReceiveUpdate &&
|
||||
null !== current &&
|
||||
current.memoizedState.memoizedState !== init &&
|
||||
current.memoizedState.memoizedState !== elementType &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
@@ -6622,7 +6647,7 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
}
|
||||
markRef(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes);
|
||||
reconcileChildren(current, workInProgress, props, renderLanes);
|
||||
return workInProgress.child;
|
||||
case 6:
|
||||
return null;
|
||||
@@ -6634,35 +6659,30 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
workInProgress,
|
||||
workInProgress.stateNode.containerInfo
|
||||
),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(props = workInProgress.pendingProps),
|
||||
null === current
|
||||
? (workInProgress.child = reconcileChildFibers(
|
||||
workInProgress,
|
||||
null,
|
||||
elementType,
|
||||
props,
|
||||
renderLanes
|
||||
))
|
||||
: reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType,
|
||||
renderLanes
|
||||
),
|
||||
: reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 11:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateForwardRef(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6698,17 +6718,17 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 10:
|
||||
a: {
|
||||
elementType = enableRenderableContext
|
||||
props = enableRenderableContext
|
||||
? workInProgress.type
|
||||
: workInProgress.type._context;
|
||||
init = workInProgress.pendingProps;
|
||||
elementType = workInProgress.pendingProps;
|
||||
nextProps = workInProgress.memoizedProps;
|
||||
nextCache = init.value;
|
||||
pushProvider(workInProgress, elementType, nextCache);
|
||||
nextCache = elementType.value;
|
||||
pushProvider(workInProgress, props, nextCache);
|
||||
if (null !== nextProps)
|
||||
if (objectIs(nextProps.value, nextCache)) {
|
||||
if (
|
||||
nextProps.children === init.children &&
|
||||
nextProps.children === elementType.children &&
|
||||
!didPerformWorkStackCursor.current
|
||||
) {
|
||||
workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
@@ -6718,35 +6738,39 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
break a;
|
||||
}
|
||||
} else
|
||||
propagateContextChange(workInProgress, elementType, renderLanes);
|
||||
reconcileChildren(current, workInProgress, init.children, renderLanes);
|
||||
} else propagateContextChange(workInProgress, props, renderLanes);
|
||||
reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType.children,
|
||||
renderLanes
|
||||
);
|
||||
workInProgress = workInProgress.child;
|
||||
}
|
||||
return workInProgress;
|
||||
case 9:
|
||||
return (
|
||||
(init = enableRenderableContext
|
||||
(elementType = enableRenderableContext
|
||||
? workInProgress.type._context
|
||||
: workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps.children),
|
||||
(props = workInProgress.pendingProps.children),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(init = readContext(init)),
|
||||
(elementType = elementType(init)),
|
||||
(elementType = readContext(elementType)),
|
||||
(props = props(elementType)),
|
||||
(workInProgress.flags |= 1),
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 14:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = resolveDefaultProps(elementType, workInProgress.pendingProps)),
|
||||
(init = resolveDefaultProps(elementType.type, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveDefaultProps(props, workInProgress.pendingProps)),
|
||||
(elementType = resolveDefaultProps(props.type, elementType)),
|
||||
updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6760,24 +6784,24 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 17:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 1),
|
||||
isContextProvider(elementType)
|
||||
isContextProvider(props)
|
||||
? ((current = !0), pushContextProvider(workInProgress))
|
||||
: (current = !1),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
constructClassInstance(workInProgress, elementType, init),
|
||||
mountClassInstance(workInProgress, elementType, init, renderLanes),
|
||||
constructClassInstance(workInProgress, props, elementType),
|
||||
mountClassInstance(workInProgress, props, elementType, renderLanes),
|
||||
finishClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
props,
|
||||
!0,
|
||||
current,
|
||||
renderLanes
|
||||
@@ -6785,19 +6809,19 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 28:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 0),
|
||||
updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6808,39 +6832,40 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
case 24:
|
||||
return (
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(elementType = readContext(CacheContext)),
|
||||
(props = readContext(CacheContext)),
|
||||
null === current
|
||||
? ((init = peekCacheFromPool()),
|
||||
null === init &&
|
||||
((init = workInProgressRoot),
|
||||
? ((elementType = peekCacheFromPool()),
|
||||
null === elementType &&
|
||||
((elementType = workInProgressRoot),
|
||||
(nextProps = createCache()),
|
||||
(init.pooledCache = nextProps),
|
||||
(elementType.pooledCache = nextProps),
|
||||
nextProps.refCount++,
|
||||
null !== nextProps && (init.pooledCacheLanes |= renderLanes),
|
||||
(init = nextProps)),
|
||||
null !== nextProps &&
|
||||
(elementType.pooledCacheLanes |= renderLanes),
|
||||
(elementType = nextProps)),
|
||||
(workInProgress.memoizedState = {
|
||||
parent: elementType,
|
||||
cache: init
|
||||
parent: props,
|
||||
cache: elementType
|
||||
}),
|
||||
initializeUpdateQueue(workInProgress),
|
||||
pushProvider(workInProgress, CacheContext, init))
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: (0 !== (current.lanes & renderLanes) &&
|
||||
(cloneUpdateQueue(current, workInProgress),
|
||||
processUpdateQueue(workInProgress, null, null, renderLanes),
|
||||
suspendIfUpdateReadFromEntangledAsyncAction()),
|
||||
(init = current.memoizedState),
|
||||
(elementType = current.memoizedState),
|
||||
(nextProps = workInProgress.memoizedState),
|
||||
init.parent !== elementType
|
||||
? ((init = { parent: elementType, cache: elementType }),
|
||||
(workInProgress.memoizedState = init),
|
||||
elementType.parent !== props
|
||||
? ((elementType = { parent: props, cache: props }),
|
||||
(workInProgress.memoizedState = elementType),
|
||||
0 === workInProgress.lanes &&
|
||||
(workInProgress.memoizedState =
|
||||
workInProgress.updateQueue.baseState =
|
||||
init),
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: ((elementType = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, elementType),
|
||||
elementType !== init.cache &&
|
||||
elementType),
|
||||
pushProvider(workInProgress, CacheContext, props))
|
||||
: ((props = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, props),
|
||||
props !== elementType.cache &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
CacheContext,
|
||||
@@ -7200,14 +7225,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$75 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$75 = lastTailNode),
|
||||
for (var lastTailNode$78 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$75
|
||||
null === lastTailNode$78
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$75.sibling = null);
|
||||
: (lastTailNode$78.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -7217,19 +7242,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$76.flags & 31457280),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (var child$79 = completedWork.child; null !== child$79; )
|
||||
(newChildLanes |= child$79.lanes | child$79.childLanes),
|
||||
(subtreeFlags |= child$79.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$79.flags & 31457280),
|
||||
(child$79.return = completedWork),
|
||||
(child$79 = child$79.sibling);
|
||||
else
|
||||
for (child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags),
|
||||
(subtreeFlags |= child$76.flags),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (child$79 = completedWork.child; null !== child$79; )
|
||||
(newChildLanes |= child$79.lanes | child$79.childLanes),
|
||||
(subtreeFlags |= child$79.subtreeFlags),
|
||||
(subtreeFlags |= child$79.flags),
|
||||
(child$79.return = completedWork),
|
||||
(child$79 = child$79.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -7741,6 +7766,15 @@ var offscreenSubtreeIsHidden = !1,
|
||||
offscreenSubtreeWasHidden = !1,
|
||||
PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
|
||||
nextEffect = null;
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
}
|
||||
function safelyAttachRef(current, nearestMountedAncestor) {
|
||||
try {
|
||||
var ref = current.ref;
|
||||
@@ -7780,8 +7814,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$98) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$98);
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$101);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -7815,13 +7849,14 @@ function commitBeforeMutationEffects(root, firstChild) {
|
||||
break;
|
||||
case 1:
|
||||
if (0 !== (flags & 1024) && null !== current) {
|
||||
var prevProps = current.memoizedProps,
|
||||
prevState = current.memoizedState,
|
||||
var prevState = current.memoizedState,
|
||||
instance = root.stateNode,
|
||||
snapshot = instance.getSnapshotBeforeUpdate(
|
||||
root.elementType === root.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(root.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
root.type,
|
||||
current.memoizedProps,
|
||||
root.elementType === root.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
||||
@@ -7885,10 +7920,10 @@ function commitHookEffectListMount(flags, finishedWork) {
|
||||
var effect = (finishedWork = finishedWork.next);
|
||||
do {
|
||||
if ((effect.tag & flags) === flags) {
|
||||
var create$99 = effect.create,
|
||||
var create$102 = effect.create,
|
||||
inst = effect.inst;
|
||||
create$99 = create$99();
|
||||
inst.destroy = create$99;
|
||||
create$102 = create$102();
|
||||
inst.destroy = create$102;
|
||||
}
|
||||
effect = effect.next;
|
||||
} while (effect !== finishedWork);
|
||||
@@ -7940,10 +7975,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
current = current.memoizedState;
|
||||
try {
|
||||
finishedRoot.componentDidUpdate(
|
||||
@@ -7951,11 +7987,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$100) {
|
||||
} catch (error$103) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$100
|
||||
error$103
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8134,9 +8170,7 @@ function commitDeletionEffectsOnFiber(
|
||||
"function" === typeof updateQueue.componentWillUnmount)
|
||||
)
|
||||
try {
|
||||
(updateQueue.props = deletedFiber.memoizedProps),
|
||||
(updateQueue.state = deletedFiber.memoizedState),
|
||||
updateQueue.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(deletedFiber, updateQueue);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -8249,8 +8283,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$102) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$102);
|
||||
} catch (error$105) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$105);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8395,10 +8429,7 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
|
||||
var current = finishedWork,
|
||||
nearestMountedAncestor = finishedWork.return;
|
||||
try {
|
||||
var current$jscomp$0 = current;
|
||||
instance.props = current$jscomp$0.memoizedProps;
|
||||
instance.state = current$jscomp$0.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(current, instance);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -9492,8 +9523,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$114) {
|
||||
handleThrow(root, thrownValue$114);
|
||||
} catch (thrownValue$117) {
|
||||
handleThrow(root, thrownValue$117);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -9601,8 +9632,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$116) {
|
||||
handleThrow(root, thrownValue$116);
|
||||
} catch (thrownValue$119) {
|
||||
handleThrow(root, thrownValue$119);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10607,10 +10638,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
}
|
||||
};
|
||||
var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1092 = {
|
||||
devToolsConfig$jscomp$inline_1101 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-canary-0e44f579",
|
||||
version: "19.0.0-canary-788ddcaa",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10626,11 +10657,11 @@ var roots = new Map(),
|
||||
}.bind(null, findNodeHandle)
|
||||
}
|
||||
};
|
||||
var internals$jscomp$inline_1326 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1092.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1092.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1092.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1092.rendererConfig,
|
||||
var internals$jscomp$inline_1334 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1101.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1101.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1101.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1101.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10646,26 +10677,26 @@ var internals$jscomp$inline_1326 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1092.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1101.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-canary-0e44f579"
|
||||
reconcilerVersion: "19.0.0-canary-788ddcaa"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1327 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1335 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1327.isDisabled &&
|
||||
hook$jscomp$inline_1327.supportsFiber
|
||||
!hook$jscomp$inline_1335.isDisabled &&
|
||||
hook$jscomp$inline_1335.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1327.inject(
|
||||
internals$jscomp$inline_1326
|
||||
(rendererID = hook$jscomp$inline_1335.inject(
|
||||
internals$jscomp$inline_1334
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1327);
|
||||
(injectedHook = hook$jscomp$inline_1335);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports.createPortal = function (children, containerTag) {
|
||||
|
||||
+269
-238
File diff suppressed because it is too large
Load Diff
+124
-59
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<c71c8b975bc5f28ac19fb8cb13f49352>>
|
||||
* @generated SignedSource<<791b1a91f550557ae891a61918d18146>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -15911,24 +15911,6 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var fakeInternalInstance = {};
|
||||
var didWarnAboutStateAssignmentForComponent;
|
||||
var didWarnAboutUninitializedState;
|
||||
@@ -16760,7 +16742,12 @@ to return true:wantsResponderID| |
|
||||
renderLanes
|
||||
) {
|
||||
var instance = workInProgress.stateNode;
|
||||
var oldProps = workInProgress.memoizedProps;
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context;
|
||||
var contextType = ctor.contextType;
|
||||
@@ -16783,7 +16770,13 @@ to return true:wantsResponderID| |
|
||||
var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
||||
var hasNewLifecycles =
|
||||
typeof getDerivedStateFromProps === "function" ||
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
typeof instance.getSnapshotBeforeUpdate === "function"; // When comparing whether props changed, we should compare using the
|
||||
// unresolved props object that is stored on the fiber, rather than the
|
||||
// one that gets assigned to the instance, because that object may have been
|
||||
// cloned to resolve default props and/or remove `ref`.
|
||||
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var didReceiveNewProps = unresolvedNewProps !== unresolvedOldProps; // Note: During these life-cycles, instance.props/instance.state are what
|
||||
// ever the previously attempted to render - not the "current". However,
|
||||
// during componentDidUpdate we pass the "current" props.
|
||||
// In order to support react-lifecycles-compat polyfilled components,
|
||||
@@ -16794,7 +16787,7 @@ to return true:wantsResponderID| |
|
||||
(typeof instance.UNSAFE_componentWillReceiveProps === "function" ||
|
||||
typeof instance.componentWillReceiveProps === "function")
|
||||
) {
|
||||
if (oldProps !== newProps || oldContext !== nextContext) {
|
||||
if (didReceiveNewProps || oldContext !== nextContext) {
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -16812,7 +16805,7 @@ to return true:wantsResponderID| |
|
||||
newState = workInProgress.memoizedState;
|
||||
|
||||
if (
|
||||
oldProps === newProps &&
|
||||
!didReceiveNewProps &&
|
||||
oldState === newState &&
|
||||
!hasContextChanged() &&
|
||||
!checkHasForceUpdateAfterProcessing()
|
||||
@@ -16909,10 +16902,11 @@ to return true:wantsResponderID| |
|
||||
var instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
var unresolvedOldProps = workInProgress.memoizedProps;
|
||||
var oldProps =
|
||||
var oldProps = resolveClassComponentProps(
|
||||
ctor,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? unresolvedOldProps
|
||||
: resolveDefaultProps(workInProgress.type, unresolvedOldProps);
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var unresolvedNewProps = workInProgress.pendingProps;
|
||||
var oldContext = instance.context;
|
||||
@@ -17081,6 +17075,53 @@ to return true:wantsResponderID| |
|
||||
return shouldUpdate;
|
||||
}
|
||||
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps, // Only resolve default props if this is a lazy component. Otherwise, they
|
||||
// would have already been resolved by the JSX runtime.
|
||||
// TODO: We're going to remove default prop resolution from the JSX runtime
|
||||
// and keep it only for class components. As part of that change, we should
|
||||
// remove this extra check.
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps; // Resolve default props. Taken from old JSX runtime, where this used to live.
|
||||
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
if (defaultProps && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (newProps[propName] === undefined) {
|
||||
newProps[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return newProps;
|
||||
}
|
||||
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
// TODO: Remove support for default props for everything except class
|
||||
// components, including setting default props on a lazy wrapper around a
|
||||
// class type.
|
||||
if (Component && Component.defaultProps) {
|
||||
// Resolve default props. Taken from ReactElement
|
||||
var props = assign({}, baseProps);
|
||||
var defaultProps = Component.defaultProps;
|
||||
|
||||
for (var propName in defaultProps) {
|
||||
if (props[propName] === undefined) {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
return baseProps;
|
||||
}
|
||||
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
// If the value is an error, call this function immediately after it is thrown
|
||||
@@ -18910,10 +18951,14 @@ to return true:wantsResponderID| |
|
||||
var Component = init(payload); // Store the unwrapped component in the type.
|
||||
|
||||
workInProgress.type = Component;
|
||||
var resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
if (typeof Component === "function") {
|
||||
if (isFunctionClassComponent(Component)) {
|
||||
var resolvedProps = resolveClassComponentProps(
|
||||
Component,
|
||||
props,
|
||||
false
|
||||
);
|
||||
workInProgress.tag = ClassComponent;
|
||||
|
||||
{
|
||||
@@ -18929,6 +18974,8 @@ to return true:wantsResponderID| |
|
||||
renderLanes
|
||||
);
|
||||
} else {
|
||||
var _resolvedProps = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = FunctionComponent;
|
||||
|
||||
{
|
||||
@@ -18941,7 +18988,7 @@ to return true:wantsResponderID| |
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -18949,6 +18996,8 @@ to return true:wantsResponderID| |
|
||||
var $$typeof = Component.$$typeof;
|
||||
|
||||
if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
||||
var _resolvedProps2 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = ForwardRef;
|
||||
|
||||
{
|
||||
@@ -18960,16 +19009,18 @@ to return true:wantsResponderID| |
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolvedProps,
|
||||
_resolvedProps2,
|
||||
renderLanes
|
||||
);
|
||||
} else if ($$typeof === REACT_MEMO_TYPE) {
|
||||
var _resolvedProps3 = resolveDefaultProps(Component, props);
|
||||
|
||||
workInProgress.tag = MemoComponent;
|
||||
return updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
Component,
|
||||
resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
|
||||
resolveDefaultProps(Component.type, _resolvedProps3), // The inner type can have defaults too
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20882,16 +20933,17 @@ to return true:wantsResponderID| |
|
||||
var _Component = workInProgress.type;
|
||||
var _unresolvedProps = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps =
|
||||
var _resolvedProps4 = resolveClassComponentProps(
|
||||
_Component,
|
||||
_unresolvedProps,
|
||||
workInProgress.elementType === _Component
|
||||
? _unresolvedProps
|
||||
: resolveDefaultProps(_Component, _unresolvedProps);
|
||||
);
|
||||
|
||||
return updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component,
|
||||
_resolvedProps,
|
||||
_resolvedProps4,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20923,7 +20975,7 @@ to return true:wantsResponderID| |
|
||||
var type = workInProgress.type;
|
||||
var _unresolvedProps2 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps2 =
|
||||
var _resolvedProps5 =
|
||||
workInProgress.elementType === type
|
||||
? _unresolvedProps2
|
||||
: resolveDefaultProps(type, _unresolvedProps2);
|
||||
@@ -20932,7 +20984,7 @@ to return true:wantsResponderID| |
|
||||
current,
|
||||
workInProgress,
|
||||
type,
|
||||
_resolvedProps2,
|
||||
_resolvedProps5,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20956,14 +21008,14 @@ to return true:wantsResponderID| |
|
||||
var _type = workInProgress.type;
|
||||
var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
|
||||
|
||||
var _resolvedProps3 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
var _resolvedProps6 = resolveDefaultProps(_type, _unresolvedProps3);
|
||||
|
||||
_resolvedProps3 = resolveDefaultProps(_type.type, _resolvedProps3);
|
||||
_resolvedProps6 = resolveDefaultProps(_type.type, _resolvedProps6);
|
||||
return updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_type,
|
||||
_resolvedProps3,
|
||||
_resolvedProps6,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -20982,16 +21034,17 @@ to return true:wantsResponderID| |
|
||||
var _Component2 = workInProgress.type;
|
||||
var _unresolvedProps4 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps4 =
|
||||
var _resolvedProps7 = resolveClassComponentProps(
|
||||
_Component2,
|
||||
_unresolvedProps4,
|
||||
workInProgress.elementType === _Component2
|
||||
? _unresolvedProps4
|
||||
: resolveDefaultProps(_Component2, _unresolvedProps4);
|
||||
);
|
||||
|
||||
return mountIncompleteClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component2,
|
||||
_resolvedProps4,
|
||||
_resolvedProps7,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -21000,16 +21053,17 @@ to return true:wantsResponderID| |
|
||||
var _Component3 = workInProgress.type;
|
||||
var _unresolvedProps5 = workInProgress.pendingProps;
|
||||
|
||||
var _resolvedProps5 =
|
||||
var _resolvedProps8 = resolveClassComponentProps(
|
||||
_Component3,
|
||||
_unresolvedProps5,
|
||||
workInProgress.elementType === _Component3
|
||||
? _unresolvedProps5
|
||||
: resolveDefaultProps(_Component3, _unresolvedProps5);
|
||||
);
|
||||
|
||||
return mountIncompleteFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
_Component3,
|
||||
_resolvedProps5,
|
||||
_resolvedProps8,
|
||||
renderLanes
|
||||
);
|
||||
}
|
||||
@@ -22928,7 +22982,11 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = current.memoizedProps;
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
|
||||
if (shouldProfile(current)) {
|
||||
@@ -23113,7 +23171,8 @@ to return true:wantsResponderID| |
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23141,9 +23200,11 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
|
||||
var snapshot = instance.getSnapshotBeforeUpdate(
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(finishedWork.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
prevProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
|
||||
@@ -23440,7 +23501,8 @@ to return true:wantsResponderID| |
|
||||
// TODO: revisit this when we implement resuming.
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23484,17 +23546,19 @@ to return true:wantsResponderID| |
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
var prevState = current.memoizedState; // We could update instance props and state here,
|
||||
// but instead we rely on them being set during last render.
|
||||
// TODO: revisit this when we implement resuming.
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -23558,7 +23622,8 @@ to return true:wantsResponderID| |
|
||||
|
||||
{
|
||||
if (
|
||||
finishedWork.type === finishedWork.elementType &&
|
||||
!finishedWork.type.defaultProps &&
|
||||
!("ref" in finishedWork.memoizedProps) &&
|
||||
!didWarnAboutReassigningProps
|
||||
) {
|
||||
if (instance.props !== finishedWork.memoizedProps) {
|
||||
@@ -30948,7 +31013,7 @@ to return true:wantsResponderID| |
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "19.0.0-canary-a548195b";
|
||||
var ReactVersion = "19.0.0-canary-7d1e5131";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
+260
-229
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a86c47bc3c7a69df1b494f89b064cc23>>
|
||||
* @generated SignedSource<<ca1c4b814a631e506c88a6a00c102a67>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -893,7 +893,7 @@ eventPluginOrder = Array.prototype.slice.call([
|
||||
"ReactNativeBridgeEventPlugin"
|
||||
]);
|
||||
recomputePluginOrdering();
|
||||
var injectedNamesToPlugins$jscomp$inline_255 = {
|
||||
var injectedNamesToPlugins$jscomp$inline_258 = {
|
||||
ResponderEventPlugin: ResponderEventPlugin,
|
||||
ReactNativeBridgeEventPlugin: {
|
||||
eventTypes: {},
|
||||
@@ -939,32 +939,32 @@ var injectedNamesToPlugins$jscomp$inline_255 = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isOrderingDirty$jscomp$inline_256 = !1,
|
||||
pluginName$jscomp$inline_257;
|
||||
for (pluginName$jscomp$inline_257 in injectedNamesToPlugins$jscomp$inline_255)
|
||||
isOrderingDirty$jscomp$inline_259 = !1,
|
||||
pluginName$jscomp$inline_260;
|
||||
for (pluginName$jscomp$inline_260 in injectedNamesToPlugins$jscomp$inline_258)
|
||||
if (
|
||||
injectedNamesToPlugins$jscomp$inline_255.hasOwnProperty(
|
||||
pluginName$jscomp$inline_257
|
||||
injectedNamesToPlugins$jscomp$inline_258.hasOwnProperty(
|
||||
pluginName$jscomp$inline_260
|
||||
)
|
||||
) {
|
||||
var pluginModule$jscomp$inline_258 =
|
||||
injectedNamesToPlugins$jscomp$inline_255[pluginName$jscomp$inline_257];
|
||||
var pluginModule$jscomp$inline_261 =
|
||||
injectedNamesToPlugins$jscomp$inline_258[pluginName$jscomp$inline_260];
|
||||
if (
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_257) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_257] !==
|
||||
pluginModule$jscomp$inline_258
|
||||
!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_260) ||
|
||||
namesToPlugins[pluginName$jscomp$inline_260] !==
|
||||
pluginModule$jscomp$inline_261
|
||||
) {
|
||||
if (namesToPlugins[pluginName$jscomp$inline_257])
|
||||
if (namesToPlugins[pluginName$jscomp$inline_260])
|
||||
throw Error(
|
||||
"EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
|
||||
(pluginName$jscomp$inline_257 + "`.")
|
||||
(pluginName$jscomp$inline_260 + "`.")
|
||||
);
|
||||
namesToPlugins[pluginName$jscomp$inline_257] =
|
||||
pluginModule$jscomp$inline_258;
|
||||
isOrderingDirty$jscomp$inline_256 = !0;
|
||||
namesToPlugins[pluginName$jscomp$inline_260] =
|
||||
pluginModule$jscomp$inline_261;
|
||||
isOrderingDirty$jscomp$inline_259 = !0;
|
||||
}
|
||||
}
|
||||
isOrderingDirty$jscomp$inline_256 && recomputePluginOrdering();
|
||||
isOrderingDirty$jscomp$inline_259 && recomputePluginOrdering();
|
||||
var instanceCache = new Map(),
|
||||
instanceProps = new Map();
|
||||
function getInstanceFromTag(tag) {
|
||||
@@ -4982,17 +4982,6 @@ enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useActionState = rerenderActionState));
|
||||
enableAsyncActions &&
|
||||
(HooksDispatcherOnRerender.useOptimistic = rerenderOptimistic);
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
function applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
ctor,
|
||||
@@ -5142,6 +5131,31 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
|
||||
"function" === typeof instance.componentDidMount &&
|
||||
(workInProgress.flags |= 4194308);
|
||||
}
|
||||
function resolveClassComponentProps(
|
||||
Component,
|
||||
baseProps,
|
||||
alreadyResolvedDefaultProps
|
||||
) {
|
||||
var newProps = baseProps;
|
||||
if ((Component = Component.defaultProps) && !alreadyResolvedDefaultProps) {
|
||||
newProps = assign({}, newProps, baseProps);
|
||||
for (var propName in Component)
|
||||
void 0 === newProps[propName] &&
|
||||
(newProps[propName] = Component[propName]);
|
||||
}
|
||||
return newProps;
|
||||
}
|
||||
function resolveDefaultProps(Component, baseProps) {
|
||||
if (Component && Component.defaultProps) {
|
||||
baseProps = assign({}, baseProps);
|
||||
Component = Component.defaultProps;
|
||||
for (var propName in Component)
|
||||
void 0 === baseProps[propName] &&
|
||||
(baseProps[propName] = Component[propName]);
|
||||
return baseProps;
|
||||
}
|
||||
return baseProps;
|
||||
}
|
||||
var CapturedStacks = new WeakMap();
|
||||
function createCapturedValueAtFiber(value, source) {
|
||||
if ("object" === typeof value && null !== value) {
|
||||
@@ -5698,7 +5712,12 @@ function updateClassComponent(
|
||||
(nextProps = !0);
|
||||
else if (null === current) {
|
||||
var instance = workInProgress.stateNode,
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
unresolvedOldProps = workInProgress.memoizedProps,
|
||||
oldProps = resolveClassComponentProps(
|
||||
Component,
|
||||
unresolvedOldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
);
|
||||
instance.props = oldProps;
|
||||
var oldContext = instance.context,
|
||||
contextType = Component.contextType;
|
||||
@@ -5712,10 +5731,11 @@ function updateClassComponent(
|
||||
hasNewLifecycles =
|
||||
"function" === typeof getDerivedStateFromProps ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate;
|
||||
unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
|
||||
hasNewLifecycles ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== nextProps || oldContext !== contextType) &&
|
||||
((unresolvedOldProps || oldContext !== contextType) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -5728,7 +5748,7 @@ function updateClassComponent(
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
oldContext = workInProgress.memoizedState;
|
||||
oldProps !== nextProps ||
|
||||
unresolvedOldProps ||
|
||||
oldState !== oldContext ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
@@ -5775,13 +5795,14 @@ function updateClassComponent(
|
||||
instance = workInProgress.stateNode;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
oldProps = workInProgress.memoizedProps;
|
||||
contextType =
|
||||
contextType = resolveClassComponentProps(
|
||||
Component,
|
||||
oldProps,
|
||||
workInProgress.type === workInProgress.elementType
|
||||
? oldProps
|
||||
: resolveDefaultProps(workInProgress.type, oldProps);
|
||||
);
|
||||
instance.props = contextType;
|
||||
hasNewLifecycles = workInProgress.pendingProps;
|
||||
oldState = instance.context;
|
||||
unresolvedOldProps = instance.context;
|
||||
oldContext = Component.contextType;
|
||||
"object" === typeof oldContext && null !== oldContext
|
||||
? (oldContext = readContext(oldContext))
|
||||
@@ -5789,13 +5810,13 @@ function updateClassComponent(
|
||||
? previousContext
|
||||
: contextStackCursor$1.current),
|
||||
(oldContext = getMaskedContext(workInProgress, oldContext)));
|
||||
var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps;
|
||||
oldState = Component.getDerivedStateFromProps;
|
||||
(getDerivedStateFromProps =
|
||||
"function" === typeof getDerivedStateFromProps$jscomp$0 ||
|
||||
"function" === typeof oldState ||
|
||||
"function" === typeof instance.getSnapshotBeforeUpdate) ||
|
||||
("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
|
||||
"function" !== typeof instance.componentWillReceiveProps) ||
|
||||
((oldProps !== hasNewLifecycles || oldState !== oldContext) &&
|
||||
((oldProps !== hasNewLifecycles || unresolvedOldProps !== oldContext) &&
|
||||
callComponentWillReceiveProps(
|
||||
workInProgress,
|
||||
instance,
|
||||
@@ -5803,20 +5824,20 @@ function updateClassComponent(
|
||||
oldContext
|
||||
));
|
||||
hasForceUpdate = !1;
|
||||
oldState = workInProgress.memoizedState;
|
||||
instance.state = oldState;
|
||||
unresolvedOldProps = workInProgress.memoizedState;
|
||||
instance.state = unresolvedOldProps;
|
||||
processUpdateQueue(workInProgress, nextProps, instance, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
var newState = workInProgress.memoizedState;
|
||||
oldProps !== hasNewLifecycles ||
|
||||
oldState !== newState ||
|
||||
unresolvedOldProps !== newState ||
|
||||
didPerformWorkStackCursor.current ||
|
||||
hasForceUpdate
|
||||
? ("function" === typeof getDerivedStateFromProps$jscomp$0 &&
|
||||
? ("function" === typeof oldState &&
|
||||
(applyDerivedStateFromProps(
|
||||
workInProgress,
|
||||
Component,
|
||||
getDerivedStateFromProps$jscomp$0,
|
||||
oldState,
|
||||
nextProps
|
||||
),
|
||||
(newState = workInProgress.memoizedState)),
|
||||
@@ -5827,7 +5848,7 @@ function updateClassComponent(
|
||||
Component,
|
||||
contextType,
|
||||
nextProps,
|
||||
oldState,
|
||||
unresolvedOldProps,
|
||||
newState,
|
||||
oldContext
|
||||
) ||
|
||||
@@ -5849,11 +5870,11 @@ function updateClassComponent(
|
||||
(workInProgress.flags |= 1024))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(workInProgress.memoizedProps = nextProps),
|
||||
(workInProgress.memoizedState = newState)),
|
||||
@@ -5863,11 +5884,11 @@ function updateClassComponent(
|
||||
(nextProps = contextType))
|
||||
: ("function" !== typeof instance.componentDidUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 4),
|
||||
"function" !== typeof instance.getSnapshotBeforeUpdate ||
|
||||
(oldProps === current.memoizedProps &&
|
||||
oldState === current.memoizedState) ||
|
||||
unresolvedOldProps === current.memoizedState) ||
|
||||
(workInProgress.flags |= 1024),
|
||||
(nextProps = !1));
|
||||
}
|
||||
@@ -6548,57 +6569,61 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
var elementType = workInProgress.elementType;
|
||||
a: {
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress);
|
||||
current = workInProgress.pendingProps;
|
||||
var init = elementType._init;
|
||||
elementType = init(elementType._payload);
|
||||
workInProgress.type = elementType;
|
||||
current = resolveDefaultProps(elementType, current);
|
||||
if ("function" === typeof elementType)
|
||||
shouldConstruct(elementType)
|
||||
? ((workInProgress.tag = 1),
|
||||
var props = workInProgress.pendingProps;
|
||||
current = elementType._init;
|
||||
current = current(elementType._payload);
|
||||
workInProgress.type = current;
|
||||
if ("function" === typeof current)
|
||||
shouldConstruct(current)
|
||||
? ((props = resolveClassComponentProps(current, props, !1)),
|
||||
(workInProgress.tag = 1),
|
||||
(workInProgress = updateClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)))
|
||||
: ((workInProgress.tag = 0),
|
||||
: ((props = resolveDefaultProps(current, props)),
|
||||
(workInProgress.tag = 0),
|
||||
(workInProgress = updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
)));
|
||||
else {
|
||||
if (void 0 !== elementType && null !== elementType)
|
||||
if (void 0 !== current && null !== current)
|
||||
if (
|
||||
((init = elementType.$$typeof), init === REACT_FORWARD_REF_TYPE)
|
||||
((elementType = current.$$typeof),
|
||||
elementType === REACT_FORWARD_REF_TYPE)
|
||||
) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 11;
|
||||
workInProgress = updateForwardRef(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
current,
|
||||
props,
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
} else if (init === REACT_MEMO_TYPE) {
|
||||
} else if (elementType === REACT_MEMO_TYPE) {
|
||||
props = resolveDefaultProps(current, props);
|
||||
workInProgress.tag = 14;
|
||||
workInProgress = updateMemoComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
resolveDefaultProps(elementType.type, current),
|
||||
current,
|
||||
resolveDefaultProps(current.type, props),
|
||||
renderLanes
|
||||
);
|
||||
break a;
|
||||
}
|
||||
throw Error(
|
||||
"Element type is invalid. Received a promise that resolves to: " +
|
||||
elementType +
|
||||
current +
|
||||
". Lazy element type must resolve to a class or function."
|
||||
);
|
||||
}
|
||||
@@ -6606,33 +6631,33 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
return workInProgress;
|
||||
case 0:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateFunctionComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
case 1:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
updateClassComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6641,34 +6666,34 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
if (null === current)
|
||||
throw Error("Should have a current fiber. This is a bug in React.");
|
||||
var nextProps = workInProgress.pendingProps;
|
||||
init = workInProgress.memoizedState;
|
||||
elementType = init.element;
|
||||
elementType = workInProgress.memoizedState;
|
||||
props = elementType.element;
|
||||
cloneUpdateQueue(current, workInProgress);
|
||||
processUpdateQueue(workInProgress, nextProps, null, renderLanes);
|
||||
nextProps = workInProgress.memoizedState;
|
||||
var nextCache = nextProps.cache;
|
||||
pushProvider(workInProgress, CacheContext, nextCache);
|
||||
nextCache !== init.cache &&
|
||||
nextCache !== elementType.cache &&
|
||||
propagateContextChange(workInProgress, CacheContext, renderLanes);
|
||||
suspendIfUpdateReadFromEntangledAsyncAction();
|
||||
init = nextProps.element;
|
||||
init === elementType
|
||||
elementType = nextProps.element;
|
||||
elementType === props
|
||||
? (workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
current,
|
||||
workInProgress,
|
||||
renderLanes
|
||||
))
|
||||
: (reconcileChildren(current, workInProgress, init, renderLanes),
|
||||
: (reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
(workInProgress = workInProgress.child));
|
||||
return workInProgress;
|
||||
case 26:
|
||||
case 27:
|
||||
case 5:
|
||||
pushHostContext(workInProgress);
|
||||
elementType = workInProgress.pendingProps.children;
|
||||
props = workInProgress.pendingProps.children;
|
||||
if (enableAsyncActions && null !== workInProgress.memoizedState) {
|
||||
if (!enableAsyncActions) throw Error("Not implemented.");
|
||||
init = renderWithHooks(
|
||||
elementType = renderWithHooks(
|
||||
current,
|
||||
workInProgress,
|
||||
TransitionAwareHostComponent,
|
||||
@@ -6676,10 +6701,10 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
null,
|
||||
renderLanes
|
||||
);
|
||||
HostTransitionContext._currentValue = init;
|
||||
HostTransitionContext._currentValue = elementType;
|
||||
didReceiveUpdate &&
|
||||
null !== current &&
|
||||
current.memoizedState.memoizedState !== init &&
|
||||
current.memoizedState.memoizedState !== elementType &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
HostTransitionContext,
|
||||
@@ -6687,7 +6712,7 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
}
|
||||
markRef(current, workInProgress);
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes);
|
||||
reconcileChildren(current, workInProgress, props, renderLanes);
|
||||
return workInProgress.child;
|
||||
case 6:
|
||||
return null;
|
||||
@@ -6699,35 +6724,30 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
workInProgress,
|
||||
workInProgress.stateNode.containerInfo
|
||||
),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(props = workInProgress.pendingProps),
|
||||
null === current
|
||||
? (workInProgress.child = reconcileChildFibers(
|
||||
workInProgress,
|
||||
null,
|
||||
elementType,
|
||||
props,
|
||||
renderLanes
|
||||
))
|
||||
: reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType,
|
||||
renderLanes
|
||||
),
|
||||
: reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 11:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps),
|
||||
(elementType =
|
||||
workInProgress.elementType === props
|
||||
? elementType
|
||||
: resolveDefaultProps(props, elementType)),
|
||||
updateForwardRef(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6763,17 +6783,17 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 10:
|
||||
a: {
|
||||
elementType = enableRenderableContext
|
||||
props = enableRenderableContext
|
||||
? workInProgress.type
|
||||
: workInProgress.type._context;
|
||||
init = workInProgress.pendingProps;
|
||||
elementType = workInProgress.pendingProps;
|
||||
nextProps = workInProgress.memoizedProps;
|
||||
nextCache = init.value;
|
||||
pushProvider(workInProgress, elementType, nextCache);
|
||||
nextCache = elementType.value;
|
||||
pushProvider(workInProgress, props, nextCache);
|
||||
if (null !== nextProps)
|
||||
if (objectIs(nextProps.value, nextCache)) {
|
||||
if (
|
||||
nextProps.children === init.children &&
|
||||
nextProps.children === elementType.children &&
|
||||
!didPerformWorkStackCursor.current
|
||||
) {
|
||||
workInProgress = bailoutOnAlreadyFinishedWork(
|
||||
@@ -6783,35 +6803,39 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
break a;
|
||||
}
|
||||
} else
|
||||
propagateContextChange(workInProgress, elementType, renderLanes);
|
||||
reconcileChildren(current, workInProgress, init.children, renderLanes);
|
||||
} else propagateContextChange(workInProgress, props, renderLanes);
|
||||
reconcileChildren(
|
||||
current,
|
||||
workInProgress,
|
||||
elementType.children,
|
||||
renderLanes
|
||||
);
|
||||
workInProgress = workInProgress.child;
|
||||
}
|
||||
return workInProgress;
|
||||
case 9:
|
||||
return (
|
||||
(init = enableRenderableContext
|
||||
(elementType = enableRenderableContext
|
||||
? workInProgress.type._context
|
||||
: workInProgress.type),
|
||||
(elementType = workInProgress.pendingProps.children),
|
||||
(props = workInProgress.pendingProps.children),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(init = readContext(init)),
|
||||
(elementType = elementType(init)),
|
||||
(elementType = readContext(elementType)),
|
||||
(props = props(elementType)),
|
||||
(workInProgress.flags |= 1),
|
||||
reconcileChildren(current, workInProgress, elementType, renderLanes),
|
||||
reconcileChildren(current, workInProgress, props, renderLanes),
|
||||
workInProgress.child
|
||||
);
|
||||
case 14:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = resolveDefaultProps(elementType, workInProgress.pendingProps)),
|
||||
(init = resolveDefaultProps(elementType.type, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveDefaultProps(props, workInProgress.pendingProps)),
|
||||
(elementType = resolveDefaultProps(props.type, elementType)),
|
||||
updateMemoComponent(
|
||||
current,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6825,24 +6849,24 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 17:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 1),
|
||||
isContextProvider(elementType)
|
||||
isContextProvider(props)
|
||||
? ((current = !0), pushContextProvider(workInProgress))
|
||||
: (current = !1),
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
constructClassInstance(workInProgress, elementType, init),
|
||||
mountClassInstance(workInProgress, elementType, init, renderLanes),
|
||||
constructClassInstance(workInProgress, props, elementType),
|
||||
mountClassInstance(workInProgress, props, elementType, renderLanes),
|
||||
finishClassComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
elementType,
|
||||
props,
|
||||
!0,
|
||||
current,
|
||||
renderLanes
|
||||
@@ -6850,19 +6874,19 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
);
|
||||
case 28:
|
||||
return (
|
||||
(elementType = workInProgress.type),
|
||||
(init = workInProgress.pendingProps),
|
||||
(init =
|
||||
workInProgress.elementType === elementType
|
||||
? init
|
||||
: resolveDefaultProps(elementType, init)),
|
||||
(props = workInProgress.type),
|
||||
(elementType = resolveClassComponentProps(
|
||||
props,
|
||||
workInProgress.pendingProps,
|
||||
workInProgress.elementType === props
|
||||
)),
|
||||
resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress),
|
||||
(workInProgress.tag = 0),
|
||||
updateFunctionComponent(
|
||||
null,
|
||||
workInProgress,
|
||||
props,
|
||||
elementType,
|
||||
init,
|
||||
renderLanes
|
||||
)
|
||||
);
|
||||
@@ -6873,39 +6897,40 @@ function beginWork(current, workInProgress, renderLanes) {
|
||||
case 24:
|
||||
return (
|
||||
prepareToReadContext(workInProgress, renderLanes),
|
||||
(elementType = readContext(CacheContext)),
|
||||
(props = readContext(CacheContext)),
|
||||
null === current
|
||||
? ((init = peekCacheFromPool()),
|
||||
null === init &&
|
||||
((init = workInProgressRoot),
|
||||
? ((elementType = peekCacheFromPool()),
|
||||
null === elementType &&
|
||||
((elementType = workInProgressRoot),
|
||||
(nextProps = createCache()),
|
||||
(init.pooledCache = nextProps),
|
||||
(elementType.pooledCache = nextProps),
|
||||
nextProps.refCount++,
|
||||
null !== nextProps && (init.pooledCacheLanes |= renderLanes),
|
||||
(init = nextProps)),
|
||||
null !== nextProps &&
|
||||
(elementType.pooledCacheLanes |= renderLanes),
|
||||
(elementType = nextProps)),
|
||||
(workInProgress.memoizedState = {
|
||||
parent: elementType,
|
||||
cache: init
|
||||
parent: props,
|
||||
cache: elementType
|
||||
}),
|
||||
initializeUpdateQueue(workInProgress),
|
||||
pushProvider(workInProgress, CacheContext, init))
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: (0 !== (current.lanes & renderLanes) &&
|
||||
(cloneUpdateQueue(current, workInProgress),
|
||||
processUpdateQueue(workInProgress, null, null, renderLanes),
|
||||
suspendIfUpdateReadFromEntangledAsyncAction()),
|
||||
(init = current.memoizedState),
|
||||
(elementType = current.memoizedState),
|
||||
(nextProps = workInProgress.memoizedState),
|
||||
init.parent !== elementType
|
||||
? ((init = { parent: elementType, cache: elementType }),
|
||||
(workInProgress.memoizedState = init),
|
||||
elementType.parent !== props
|
||||
? ((elementType = { parent: props, cache: props }),
|
||||
(workInProgress.memoizedState = elementType),
|
||||
0 === workInProgress.lanes &&
|
||||
(workInProgress.memoizedState =
|
||||
workInProgress.updateQueue.baseState =
|
||||
init),
|
||||
pushProvider(workInProgress, CacheContext, elementType))
|
||||
: ((elementType = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, elementType),
|
||||
elementType !== init.cache &&
|
||||
elementType),
|
||||
pushProvider(workInProgress, CacheContext, props))
|
||||
: ((props = nextProps.cache),
|
||||
pushProvider(workInProgress, CacheContext, props),
|
||||
props !== elementType.cache &&
|
||||
propagateContextChange(
|
||||
workInProgress,
|
||||
CacheContext,
|
||||
@@ -7154,14 +7179,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
|
||||
break;
|
||||
case "collapsed":
|
||||
lastTailNode = renderState.tail;
|
||||
for (var lastTailNode$75 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$75 = lastTailNode),
|
||||
for (var lastTailNode$78 = null; null !== lastTailNode; )
|
||||
null !== lastTailNode.alternate && (lastTailNode$78 = lastTailNode),
|
||||
(lastTailNode = lastTailNode.sibling);
|
||||
null === lastTailNode$75
|
||||
null === lastTailNode$78
|
||||
? hasRenderedATailFallback || null === renderState.tail
|
||||
? (renderState.tail = null)
|
||||
: (renderState.tail.sibling = null)
|
||||
: (lastTailNode$75.sibling = null);
|
||||
: (lastTailNode$78.sibling = null);
|
||||
}
|
||||
}
|
||||
function bubbleProperties(completedWork) {
|
||||
@@ -7171,19 +7196,19 @@ function bubbleProperties(completedWork) {
|
||||
newChildLanes = 0,
|
||||
subtreeFlags = 0;
|
||||
if (didBailout)
|
||||
for (var child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$76.flags & 31457280),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (var child$79 = completedWork.child; null !== child$79; )
|
||||
(newChildLanes |= child$79.lanes | child$79.childLanes),
|
||||
(subtreeFlags |= child$79.subtreeFlags & 31457280),
|
||||
(subtreeFlags |= child$79.flags & 31457280),
|
||||
(child$79.return = completedWork),
|
||||
(child$79 = child$79.sibling);
|
||||
else
|
||||
for (child$76 = completedWork.child; null !== child$76; )
|
||||
(newChildLanes |= child$76.lanes | child$76.childLanes),
|
||||
(subtreeFlags |= child$76.subtreeFlags),
|
||||
(subtreeFlags |= child$76.flags),
|
||||
(child$76.return = completedWork),
|
||||
(child$76 = child$76.sibling);
|
||||
for (child$79 = completedWork.child; null !== child$79; )
|
||||
(newChildLanes |= child$79.lanes | child$79.childLanes),
|
||||
(subtreeFlags |= child$79.subtreeFlags),
|
||||
(subtreeFlags |= child$79.flags),
|
||||
(child$79.return = completedWork),
|
||||
(child$79 = child$79.sibling);
|
||||
completedWork.subtreeFlags |= subtreeFlags;
|
||||
completedWork.childLanes = newChildLanes;
|
||||
return didBailout;
|
||||
@@ -7650,6 +7675,15 @@ var offscreenSubtreeIsHidden = !1,
|
||||
offscreenSubtreeWasHidden = !1,
|
||||
PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set,
|
||||
nextEffect = null;
|
||||
function callComponentWillUnmountWithTimer(current, instance) {
|
||||
instance.props = resolveClassComponentProps(
|
||||
current.type,
|
||||
current.memoizedProps,
|
||||
current.elementType === current.type
|
||||
);
|
||||
instance.state = current.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
}
|
||||
function safelyAttachRef(current, nearestMountedAncestor) {
|
||||
try {
|
||||
var ref = current.ref;
|
||||
@@ -7689,8 +7723,8 @@ function safelyDetachRef(current, nearestMountedAncestor) {
|
||||
else if ("function" === typeof ref)
|
||||
try {
|
||||
ref(null);
|
||||
} catch (error$98) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$98);
|
||||
} catch (error$101) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error$101);
|
||||
}
|
||||
else ref.current = null;
|
||||
}
|
||||
@@ -7724,13 +7758,14 @@ function commitBeforeMutationEffects(root, firstChild) {
|
||||
break;
|
||||
case 1:
|
||||
if (0 !== (flags & 1024) && null !== current) {
|
||||
var prevProps = current.memoizedProps,
|
||||
prevState = current.memoizedState,
|
||||
var prevState = current.memoizedState,
|
||||
instance = root.stateNode,
|
||||
snapshot = instance.getSnapshotBeforeUpdate(
|
||||
root.elementType === root.type
|
||||
? prevProps
|
||||
: resolveDefaultProps(root.type, prevProps),
|
||||
resolveClassComponentProps(
|
||||
root.type,
|
||||
current.memoizedProps,
|
||||
root.elementType === root.type
|
||||
),
|
||||
prevState
|
||||
);
|
||||
instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
||||
@@ -7794,10 +7829,10 @@ function commitHookEffectListMount(flags, finishedWork) {
|
||||
var effect = (finishedWork = finishedWork.next);
|
||||
do {
|
||||
if ((effect.tag & flags) === flags) {
|
||||
var create$99 = effect.create,
|
||||
var create$102 = effect.create,
|
||||
inst = effect.inst;
|
||||
create$99 = create$99();
|
||||
inst.destroy = create$99;
|
||||
create$102 = create$102();
|
||||
inst.destroy = create$102;
|
||||
}
|
||||
effect = effect.next;
|
||||
} while (effect !== finishedWork);
|
||||
@@ -7840,10 +7875,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
else {
|
||||
var prevProps =
|
||||
var prevProps = resolveClassComponentProps(
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.elementType === finishedWork.type
|
||||
? current.memoizedProps
|
||||
: resolveDefaultProps(finishedWork.type, current.memoizedProps);
|
||||
);
|
||||
current = current.memoizedState;
|
||||
try {
|
||||
finishedRoot.componentDidUpdate(
|
||||
@@ -7851,11 +7887,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
|
||||
current,
|
||||
finishedRoot.__reactInternalSnapshotBeforeUpdate
|
||||
);
|
||||
} catch (error$100) {
|
||||
} catch (error$103) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$100
|
||||
error$103
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8176,9 +8212,7 @@ function commitDeletionEffectsOnFiber(
|
||||
"function" === typeof prevHostParent.componentWillUnmount)
|
||||
)
|
||||
try {
|
||||
(prevHostParent.props = deletedFiber.memoizedProps),
|
||||
(prevHostParent.state = deletedFiber.memoizedState),
|
||||
prevHostParent.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(deletedFiber, prevHostParent);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -8318,8 +8352,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
}
|
||||
try {
|
||||
commitHookEffectListUnmount(5, finishedWork, finishedWork.return);
|
||||
} catch (error$108) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$108);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8366,8 +8400,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
viewConfig.uiViewClassName,
|
||||
updatePayload
|
||||
);
|
||||
} catch (error$111) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$111);
|
||||
} catch (error$114) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$114);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8387,8 +8421,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
"RCTRawText",
|
||||
{ text: current }
|
||||
);
|
||||
} catch (error$112) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$112);
|
||||
} catch (error$115) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$115);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8500,11 +8534,11 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (null === current)
|
||||
try {
|
||||
throw Error("Not yet implemented.");
|
||||
} catch (error$102) {
|
||||
} catch (error$105) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$102
|
||||
error$105
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
@@ -8578,12 +8612,12 @@ function commitReconciliationEffects(finishedWork) {
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
var parent$103 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$104 = getHostSibling(finishedWork);
|
||||
var parent$106 = JSCompiler_inline_result.stateNode.containerInfo,
|
||||
before$107 = getHostSibling(finishedWork);
|
||||
insertOrAppendPlacementNodeIntoContainer(
|
||||
finishedWork,
|
||||
before$104,
|
||||
parent$103
|
||||
before$107,
|
||||
parent$106
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -8622,10 +8656,7 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
|
||||
var current = finishedWork,
|
||||
nearestMountedAncestor = finishedWork.return;
|
||||
try {
|
||||
var current$jscomp$0 = current;
|
||||
instance.props = current$jscomp$0.memoizedProps;
|
||||
instance.state = current$jscomp$0.memoizedState;
|
||||
instance.componentWillUnmount();
|
||||
callComponentWillUnmountWithTimer(current, instance);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(current, nearestMountedAncestor, error);
|
||||
}
|
||||
@@ -9701,8 +9732,8 @@ function renderRootSync(root, lanes) {
|
||||
}
|
||||
workLoopSync();
|
||||
break;
|
||||
} catch (thrownValue$120) {
|
||||
handleThrow(root, thrownValue$120);
|
||||
} catch (thrownValue$123) {
|
||||
handleThrow(root, thrownValue$123);
|
||||
}
|
||||
while (1);
|
||||
lanes && root.shellSuspendCounter++;
|
||||
@@ -9810,8 +9841,8 @@ function renderRootConcurrent(root, lanes) {
|
||||
}
|
||||
workLoopConcurrent();
|
||||
break;
|
||||
} catch (thrownValue$122) {
|
||||
handleThrow(root, thrownValue$122);
|
||||
} catch (thrownValue$125) {
|
||||
handleThrow(root, thrownValue$125);
|
||||
}
|
||||
while (1);
|
||||
resetContextDependencies();
|
||||
@@ -10823,10 +10854,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
}
|
||||
};
|
||||
var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1159 = {
|
||||
devToolsConfig$jscomp$inline_1168 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "19.0.0-canary-e621cb36",
|
||||
version: "19.0.0-canary-1766b206",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForInstance: getInspectorDataForInstance,
|
||||
@@ -10842,11 +10873,11 @@ var roots = new Map(),
|
||||
}.bind(null, findNodeHandle)
|
||||
}
|
||||
};
|
||||
var internals$jscomp$inline_1407 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1159.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1159.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1159.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1159.rendererConfig,
|
||||
var internals$jscomp$inline_1415 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1168.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1168.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1168.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1168.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10862,26 +10893,26 @@ var internals$jscomp$inline_1407 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1159.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1168.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "19.0.0-canary-e621cb36"
|
||||
reconcilerVersion: "19.0.0-canary-1766b206"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1408 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1416 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1408.isDisabled &&
|
||||
hook$jscomp$inline_1408.supportsFiber
|
||||
!hook$jscomp$inline_1416.isDisabled &&
|
||||
hook$jscomp$inline_1416.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1408.inject(
|
||||
internals$jscomp$inline_1407
|
||||
(rendererID = hook$jscomp$inline_1416.inject(
|
||||
internals$jscomp$inline_1415
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1408);
|
||||
(injectedHook = hook$jscomp$inline_1416);
|
||||
} catch (err) {}
|
||||
}
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
|
||||
+279
-248
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user