React Native sync

Reviewed By: sebmarkbage

Differential Revision: D5214576

fbshipit-source-id: 41f350ce8961851c7404257df8295d505471d9f4
This commit is contained in:
Brian Vaughn 2017-06-08 19:01:23 -07:00 committed by Facebook Github Bot
parent 32a0ee0975
commit a4947d1778
7 changed files with 1660 additions and 1356 deletions

View File

@ -1 +1 @@
3630bf3559b72d66437187901fb5eab3f976c6a4 a37012a6b5fb5a1c0c19c962737189aeaebe3684

View File

@ -19,7 +19,7 @@ var RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/
require("ReactNativeFeatureFlags"); require("ReactNativeFeatureFlags");
var ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function() { var ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function(capturedError) {
return !0; return !0;
}, showDialog = defaultShowDialog; }, showDialog = defaultShowDialog;
@ -1094,20 +1094,19 @@ var ReactNativeInjection = {
isPortal: isPortal, isPortal: isPortal,
REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1
}, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { }, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = {
logTopLevelRenders: !1,
prepareNewChildrenBeforeUnmountInStack: !0,
disableNewFiberFeatures: !1, disableNewFiberFeatures: !1,
enableAsyncSubtreeAPI: !1 enableAsyncSubtreeAPI: !1
}, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { }, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = {
NoEffect: 0, NoEffect: 0,
Placement: 1, PerformedWork: 1,
Update: 2, Placement: 2,
PlacementAndUpdate: 3, Update: 4,
Deletion: 4, PlacementAndUpdate: 6,
ContentReset: 8, Deletion: 8,
Callback: 16, ContentReset: 16,
Err: 32, Callback: 32,
Ref: 64 Err: 64,
Ref: 128
}, ReactPriorityLevel = { }, ReactPriorityLevel = {
NoWork: 0, NoWork: 0,
SynchronousPriority: 1, SynchronousPriority: 1,
@ -1331,7 +1330,7 @@ Object.assign(ReactGlobalSharedState, {
ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame
}); });
var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3;
function isFiberMountedImpl(fiber) { function isFiberMountedImpl(fiber) {
var node = fiber; var node = fiber;
@ -1414,7 +1413,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent
var currentParent = findCurrentFiberUsingSlowPath(parent); var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) return null; if (!currentParent) return null;
for (var node = currentParent; !0; ) { for (var node = currentParent; !0; ) {
if (node.tag === HostComponent$1 || node.tag === HostText) return node; if (node.tag === HostComponent$2 || node.tag === HostText) return node;
if (node.child) node.child.return = node, node = node.child; else { if (node.child) node.child.return = node, node = node.child; else {
if (node === currentParent) return null; if (node === currentParent) return null;
for (;!node.sibling; ) { for (;!node.sibling; ) {
@ -1450,7 +1449,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent
pop: pop$1, pop: pop$1,
push: push$1, push: push$1,
reset: reset reset: reset
}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$2 = ReactTypeOfWork.HostComponent; }, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$3 = ReactTypeOfWork.HostComponent;
function describeComponentFrame(name, source, ownerName) { function describeComponentFrame(name, source, ownerName) {
return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : "");
@ -1461,7 +1460,7 @@ function describeFiber(fiber) {
case IndeterminateComponent: case IndeterminateComponent:
case FunctionalComponent: case FunctionalComponent:
case ClassComponent$2: case ClassComponent$2:
case HostComponent$2: case HostComponent$3:
var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null;
return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName);
@ -1498,7 +1497,7 @@ var ReactDebugCurrentFiber$2 = {
phase: null, phase: null,
getCurrentFiberOwnerName: getCurrentFiberOwnerName, getCurrentFiberOwnerName: getCurrentFiberOwnerName,
getCurrentFiberStackAddendum: getCurrentFiberStackAddendum getCurrentFiberStackAddendum: getCurrentFiberStackAddendum
}, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$3 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "⚛", warningEmoji = "⛔", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) { }, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$4 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "⚛", warningEmoji = "⛔", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) {
return reactEmoji + " " + markName; return reactEmoji + " " + markName;
}, formatLabel = function(label, warning$$1) { }, formatLabel = function(label, warning$$1) {
return (warning$$1 ? warningEmoji + " " : reactEmoji + " ") + label + (warning$$1 ? " Warning: " + warning$$1 : ""); return (warning$$1 ? warningEmoji + " " : reactEmoji + " ") + label + (warning$$1 ? " Warning: " + warning$$1 : "");
@ -1531,7 +1530,7 @@ var ReactDebugCurrentFiber$2 = {
}, shouldIgnoreFiber = function(fiber) { }, shouldIgnoreFiber = function(fiber) {
switch (fiber.tag) { switch (fiber.tag) {
case HostRoot$2: case HostRoot$2:
case HostComponent$3: case HostComponent$4:
case HostText$1: case HostText$1:
case HostPortal: case HostPortal:
case YieldComponent: case YieldComponent:
@ -1736,7 +1735,7 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio
}, ReactTypeOfInternalContext = { }, ReactTypeOfInternalContext = {
NoContext: 0, NoContext: 0,
AsyncUpdates: 1 AsyncUpdates: 1
}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1; }, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1;
try { try {
var nonExtensibleObject = Object.preventExtensions({}); var nonExtensibleObject = Object.preventExtensions({});
@ -1813,7 +1812,7 @@ var cloneFiber = function(fiber, priorityLevel) {
function createFiberFromElementType(type, key, internalContextTag, debugOwner) { function createFiberFromElementType(type, key, internalContextTag, debugOwner) {
var fiber = void 0; var fiber = void 0;
if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag), if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag),
fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$4, key, internalContextTag), fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$5, key, internalContextTag),
fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else {
var info = ""; var info = "";
(void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."); (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in.");
@ -1824,7 +1823,7 @@ function createFiberFromElementType(type, key, internalContextTag, debugOwner) {
} }
var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() {
var fiber = createFiber(HostComponent$4, null, NoContext); var fiber = createFiber(HostComponent$5, null, NoContext);
return fiber.type = "DELETED", fiber; return fiber.type = "DELETED", fiber;
}, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { }, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) {
var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag);
@ -1906,11 +1905,11 @@ var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT
if (null !== child && "object" == typeof child && child._store && !child._store.validated && null == child.key) { if (null !== child && "object" == typeof child && child._store && !child._store.validated && null == child.key) {
invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"), invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"),
child._store.validated = !0; child._store.validated = !0;
var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1(child) || ""); var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1() || "");
ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0, ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0,
warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1(child))); warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1()));
} }
}, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$3 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; }, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion;
function coerceRef(current, element) { function coerceRef(current, element) {
var mixedRef = element.ref; var mixedRef = element.ref;
@ -1969,7 +1968,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
var clone = cloneFiber$2(fiber, priority); var clone = cloneFiber$2(fiber, priority);
return clone.index = 0, clone.sibling = null, clone; return clone.index = 0, clone.sibling = null, clone;
} }
return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$3, fiber.index = 0, return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0,
fiber.sibling = null, fiber; fiber.sibling = null, fiber;
} }
function placeChild(newFiber, lastPlacedIndex, newIndex) { function placeChild(newFiber, lastPlacedIndex, newIndex) {
@ -2498,7 +2497,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
resumeMountClassInstance: resumeMountClassInstance, resumeMountClassInstance: resumeMountClassInstance,
updateClassInstance: updateClassInstance updateClassInstance: updateClassInstance
}; };
}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { }, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) {
var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
function markChildAsProgressed(current, workInProgress, priorityLevel) { function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
@ -2538,8 +2537,9 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} }
var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext);
return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render", return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render",
nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, reconcileChildren(current, workInProgress, nextChildren), nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1,
memoizeProps(workInProgress, nextProps), workInProgress.child; reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps),
workInProgress.child;
} }
function updateClassComponent(current, workInProgress, priorityLevel) { function updateClassComponent(current, workInProgress, priorityLevel) {
var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0;
@ -2553,9 +2553,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
ReactCurrentOwner$2.current = workInProgress; ReactCurrentOwner$2.current = workInProgress;
var nextChildren = void 0; var nextChildren = void 0;
return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(), return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(),
ReactDebugCurrentFiber$4.phase = null, reconcileChildren(current, workInProgress, nextChildren), ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1,
memoizeState(workInProgress, instance.state), memoizeProps(workInProgress, instance.props), reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state),
hasContext && invalidateContextProvider$1(workInProgress), workInProgress.child; memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress),
workInProgress.child;
} }
function updateHostRoot(current, workInProgress, priorityLevel) { function updateHostRoot(current, workInProgress, priorityLevel) {
var root = workInProgress.stateNode; var root = workInProgress.stateNode;
@ -2567,17 +2568,18 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
var element = state.element; var element = state.element;
return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(),
reconcileChildren(current, workInProgress, element), memoizeState(workInProgress, state), reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2,
workInProgress.child) : (workInProgress.effectTag |= Placement$2, workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel),
markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child); markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state),
workInProgress.child;
} }
return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
} }
function updateHostComponent(current, workInProgress) { function updateHostComponent(current, workInProgress) {
pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress);
var nextProps = workInProgress.pendingProps, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps;
if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) {
if (!useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1,
child = child.sibling; child = child.sibling;
return null; return null;
@ -2585,7 +2587,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
return bailoutOnAlreadyFinishedWork(current, workInProgress); return bailoutOnAlreadyFinishedWork(current, workInProgress);
} }
var nextChildren = nextProps.children; var nextChildren = nextProps.children;
if (shouldSetTextContent(nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(prevProps) && (workInProgress.effectTag |= ContentReset$1), if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1),
markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild),
reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1),
@ -2606,7 +2608,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
function mountIndeterminateComponent(current, workInProgress, priorityLevel) { function mountIndeterminateComponent(current, workInProgress, priorityLevel) {
invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue.");
var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext);
if (ReactCurrentOwner$2.current = workInProgress, "object" == typeof (value = fn(props, context)) && null !== value && "function" == typeof value.render) { if (ReactCurrentOwner$2.current = workInProgress, value = fn(props, context), workInProgress.effectTag |= PerformedWork$1,
"object" == typeof value && null !== value && "function" == typeof value.render) {
workInProgress.tag = ClassComponent$5; workInProgress.tag = ClassComponent$5;
var hasContext = pushContextProvider$1(workInProgress); var hasContext = pushContextProvider$1(workInProgress);
return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel),
@ -2687,7 +2690,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
case HostRoot$5: case HostRoot$5:
return updateHostRoot(current, workInProgress, priorityLevel); return updateHostRoot(current, workInProgress, priorityLevel);
case HostComponent$6: case HostComponent$7:
return updateHostComponent(current, workInProgress); return updateHostComponent(current, workInProgress);
case HostText$3: case HostText$3:
@ -2727,8 +2730,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
beginWork: beginWork, beginWork: beginWork,
beginFailedWork: beginFailedWork beginFailedWork: beginFailedWork
}; };
}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { }, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) {
var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, hydrateHostInstance = hydrationContext.hydrateHostInstance, hydrateHostTextInstance = hydrationContext.hydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState;
function markChildAsProgressed(current, workInProgress, priorityLevel) { function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority);
@ -2742,7 +2745,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
function appendAllYields(yields, workInProgress) { function appendAllYields(yields, workInProgress) {
var node = workInProgress.stateNode; var node = workInProgress.stateNode;
for (node && (node.return = workInProgress); null !== node; ) { for (node && (node.return = workInProgress); null !== node; ) {
if (node.tag === HostComponent$7 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) { if (node.tag === HostComponent$8 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
continue; continue;
} }
@ -2765,7 +2768,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} }
function appendAllChildren(parent, workInProgress) { function appendAllChildren(parent, workInProgress) {
for (var node = workInProgress.child; null !== node; ) { for (var node = workInProgress.child; null !== node; ) {
if (node.tag === HostComponent$7 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { if (node.tag === HostComponent$8 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) {
node = node.child; node = node.child;
continue; continue;
} }
@ -2791,7 +2794,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress),
workInProgress.effectTag &= ~Placement$4), null; workInProgress.effectTag &= ~Placement$4), null;
case HostComponent$7: case HostComponent$8:
popHostContext(workInProgress); popHostContext(workInProgress);
var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps;
if (null !== current && null != workInProgress.stateNode) { if (null !== current && null != workInProgress.stateNode) {
@ -2801,10 +2804,13 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} else { } else {
if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."),
null; null;
var _currentHostContext = getHostContext(), _instance = void 0; var _currentHostContext = getHostContext();
popHydrationState(workInProgress) ? _instance = hydrateHostInstance(workInProgress, rootContainerInstance) : (_instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress), if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else {
appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress)), var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress);
workInProgress.stateNode = _instance, null !== workInProgress.ref && markRef(workInProgress); appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress),
workInProgress.stateNode = _instance;
}
null !== workInProgress.ref && markRef(workInProgress);
} }
return null; return null;
@ -2815,9 +2821,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} else { } else {
if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."),
null; null;
var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(), textInstance = void 0; var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext();
textInstance = popHydrationState(workInProgress) ? hydrateHostTextInstance(workInProgress, _rootContainerInstance) : createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress), popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress);
workInProgress.stateNode = textInstance;
} }
return null; return null;
@ -2869,7 +2874,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
injectInternals: injectInternals_1, injectInternals: injectInternals_1,
onCommitRoot: onCommitRoot_1, onCommitRoot: onCommitRoot_1,
onCommitUnmount: onCommitUnmount_1 onCommitUnmount: onCommitUnmount_1
}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) { }, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) {
var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance, callComponentWillUnmountWithTimerInDev = function(current, instance) { var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance, callComponentWillUnmountWithTimerInDev = function(current, instance) {
startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(), startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(),
stopPhaseTimer$2(); stopPhaseTimer$2();
@ -2888,7 +2893,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function getHostParent(fiber) { function getHostParent(fiber) {
for (var parent = fiber.return; null !== parent; ) { for (var parent = fiber.return; null !== parent; ) {
switch (parent.tag) { switch (parent.tag) {
case HostComponent$8: case HostComponent$9:
return parent.stateNode; return parent.stateNode;
case HostRoot$7: case HostRoot$7:
@ -2907,7 +2912,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue.");
} }
function isHostParent(fiber) { function isHostParent(fiber) {
return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6; return fiber.tag === HostComponent$9 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6;
} }
function getHostSibling(fiber) { function getHostSibling(fiber) {
var node = fiber; var node = fiber;
@ -2916,7 +2921,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
if (null === node.return || isHostParent(node.return)) return null; if (null === node.return || isHostParent(node.return)) return null;
node = node.return; node = node.return;
} }
for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$8 && node.tag !== HostText$6; ) { for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$9 && node.tag !== HostText$6; ) {
if (node.effectTag & Placement$5) continue siblings; if (node.effectTag & Placement$5) continue siblings;
if (null === node.child || node.tag === HostPortal$6) continue siblings; if (null === node.child || node.tag === HostPortal$6) continue siblings;
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
@ -2927,7 +2932,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function commitPlacement(finishedWork) { function commitPlacement(finishedWork) {
var parentFiber = getHostParentFiber(finishedWork), parent = void 0; var parentFiber = getHostParentFiber(finishedWork), parent = void 0;
switch (parentFiber.tag) { switch (parentFiber.tag) {
case HostComponent$8: case HostComponent$9:
parent = parentFiber.stateNode; parent = parentFiber.stateNode;
break; break;
@ -2941,7 +2946,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2);
for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) {
if (node.tag === HostComponent$8 || node.tag === HostText$6) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) { if (node.tag === HostComponent$9 || node.tag === HostText$6) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
continue; continue;
} }
@ -2965,7 +2970,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
function unmountHostComponents(parent, current) { function unmountHostComponents(parent, current) {
for (var node = current; !0; ) { for (var node = current; !0; ) {
if (node.tag === HostComponent$8 || node.tag === HostText$6) commitNestedUnmounts(node), if (node.tag === HostComponent$9 || node.tag === HostText$6) commitNestedUnmounts(node),
removeChild(parent, node.stateNode); else if (node.tag === HostPortal$6) { removeChild(parent, node.stateNode); else if (node.tag === HostPortal$6) {
if (parent = node.stateNode.containerInfo, null !== node.child) { if (parent = node.stateNode.containerInfo, null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
@ -2994,7 +2999,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var instance = current.stateNode; var instance = current.stateNode;
return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance));
case HostComponent$8: case HostComponent$9:
return void safelyDetachRef(current); return void safelyDetachRef(current);
case CoroutineComponent$4: case CoroutineComponent$4:
@ -3009,17 +3014,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
case ClassComponent$8: case ClassComponent$8:
return; return;
case HostComponent$8: case HostComponent$9:
var instance = finishedWork.stateNode; var instance = finishedWork.stateNode;
if (null != instance && null !== current) { if (null != instance) {
var newProps = finishedWork.memoizedProps, oldProps = current.memoizedProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue;
finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
} }
return; return;
case HostText$6: case HostText$6:
invariant(null !== finishedWork.stateNode && null !== current, "This should only be done during updates. This error is likely " + "caused by a bug in React. Please file an issue."); invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue.");
var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = current.memoizedProps; var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText;
return void commitTextUpdate(textInstance, oldText, newText); return void commitTextUpdate(textInstance, oldText, newText);
case HostRoot$7: case HostRoot$7:
@ -3050,7 +3055,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
return; return;
case HostComponent$8: case HostComponent$9:
var _instance2 = finishedWork.stateNode; var _instance2 = finishedWork.stateNode;
if (null === current && finishedWork.effectTag & Update$3) { if (null === current && finishedWork.effectTag & Update$3) {
var type = finishedWork.type, props = finishedWork.memoizedProps; var type = finishedWork.type, props = finishedWork.memoizedProps;
@ -3069,7 +3074,15 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function commitAttachRef(finishedWork) { function commitAttachRef(finishedWork) {
var ref = finishedWork.ref; var ref = finishedWork.ref;
if (null !== ref) { if (null !== ref) {
ref(getPublicInstance(finishedWork.stateNode)); var instance = finishedWork.stateNode;
switch (finishedWork.tag) {
case HostComponent$9:
ref(getPublicInstance(instance));
break;
default:
ref(instance);
}
} }
} }
function commitDetachRef(current) { function commitDetachRef(current) {
@ -3124,7 +3137,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
pushHostContext: pushHostContext, pushHostContext: pushHostContext,
resetHostContainer: resetHostContainer resetHostContainer: resetHostContainer
}; };
}, HostComponent$9 = ReactTypeOfWork.HostComponent, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { }, HostComponent$10 = ReactTypeOfWork.HostComponent, HostText$7 = ReactTypeOfWork.HostText, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) {
var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance;
if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return {
enterHydrationState: function() { enterHydrationState: function() {
@ -3132,10 +3145,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}, },
resetHydrationState: function() {}, resetHydrationState: function() {},
tryToClaimNextHydratableInstance: function() {}, tryToClaimNextHydratableInstance: function() {},
hydrateHostInstance: function() { prepareToHydrateHostInstance: function() {
invariant(!1, "React bug."); invariant(!1, "React bug.");
}, },
hydrateHostTextInstance: function() { prepareToHydrateHostTextInstance: function() {
invariant(!1, "React bug."); invariant(!1, "React bug.");
}, },
popHydrationState: function(fiber) { popHydrationState: function(fiber) {
@ -3150,42 +3163,52 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
function deleteHydratableInstance(returnFiber, instance) { function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion$1(); var childToDelete = createFiberFromHostInstanceForDeletion$1();
childToDelete.stateNode = instance, childToDelete.return = returnFiber; childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2,
var last = returnFiber.progressedLastDeletion; null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete,
null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete,
childToDelete.effectTag = Deletion$2, null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete,
returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
} }
function canHydrate(fiber, nextInstance) {
switch (fiber.tag) {
case HostComponent$10:
var type = fiber.type, props = fiber.memoizedProps;
return canHydrateInstance(nextInstance, type, props);
case HostText$7:
return canHydrateTextInstance(nextInstance);
default:
return !1;
}
}
function tryToClaimNextHydratableInstance(fiber) { function tryToClaimNextHydratableInstance(fiber) {
if (isHydrating) { if (isHydrating) {
var nextInstance = nextHydratableInstance; var nextInstance = nextHydratableInstance;
if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber);
var type = fiber.type, props = fiber.memoizedProps; if (!canHydrate(fiber, nextInstance)) {
if (!canHydrateInstance(nextInstance, type, props)) { if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6,
if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrateInstance(nextInstance, type, props)) return fiber.effectTag |= Placement$6,
isHydrating = !1, void (hydrationParentFiber = fiber); isHydrating = !1, void (hydrationParentFiber = fiber);
deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);
} }
fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance);
} }
} }
function hydrateHostInstance(fiber, rootContainerInstance) { function prepareToHydrateHostInstance(fiber, rootContainerInstance) {
var instance = fiber.stateNode; var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber);
return hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber), return fiber.updateQueue = updatePayload, null !== updatePayload;
instance;
} }
function hydrateHostTextInstance(fiber) { function prepareToHydrateHostTextInstance(fiber) {
var textInstance = fiber.stateNode; var textInstance = fiber.stateNode;
return hydrateTextInstance(textInstance, fiber), textInstance; return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber);
} }
function popToNextHostParent(fiber) { function popToNextHostParent(fiber) {
for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$8; ) parent = parent.return; for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$10 && parent.tag !== HostRoot$8; ) parent = parent.return;
hydrationParentFiber = parent; hydrationParentFiber = parent;
} }
function popHydrationState(fiber) { function popHydrationState(fiber) {
if (fiber !== hydrationParentFiber) return !1; if (fiber !== hydrationParentFiber) return !1;
if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1;
if (fiber.tag !== HostComponent$9 || "head" !== fiber.type && "body" !== fiber.type && !shouldSetTextContent(fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), var type = fiber.type;
if (fiber.tag !== HostComponent$10 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance),
nextInstance = getNextHydratableSibling(nextInstance); nextInstance = getNextHydratableSibling(nextInstance);
return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null,
!0; !0;
@ -3197,13 +3220,13 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
enterHydrationState: enterHydrationState, enterHydrationState: enterHydrationState,
resetHydrationState: resetHydrationState, resetHydrationState: resetHydrationState,
tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance,
hydrateHostInstance: hydrateHostInstance, prepareToHydrateHostInstance: prepareToHydrateHostInstance,
hydrateHostTextInstance: hydrateHostTextInstance, prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,
popHydrationState: popHydrationState popHydrationState: popHydrationState
}; };
}, ReactFiberInstrumentation$2 = { }, ReactFiberInstrumentation$2 = {
debugTool: null debugTool: null
}, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) { }, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) {
var ctor = instance.constructor; var ctor = instance.constructor;
warning$5(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"); warning$5(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass");
}, warnAboutInvalidUpdates = function(instance) { }, warnAboutInvalidUpdates = function(instance) {
@ -3248,7 +3271,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var current = nextEffect.alternate; var current = nextEffect.alternate;
null !== current && commitDetachRef(current); null !== current && commitDetachRef(current);
} }
switch (effectTag & ~(Callback | Err | ContentReset | Ref)) { switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) {
case Placement$1: case Placement$1:
commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1;
break; break;
@ -3293,20 +3316,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var previousPriorityContext = priorityContext; var previousPriorityContext = priorityContext;
priorityContext = TaskPriority$1; priorityContext = TaskPriority$1;
var firstEffect = void 0; var firstEffect = void 0;
finishedWork.effectTag !== NoEffect$2 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork,
firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect; firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect,
var commitInfo = prepareForCommit(); prepareForCommit(), nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) {
for (nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) {
var _error = null; var _error = null;
_error = invokeGuardedCallback$1(null, commitAllHostEffects, null, finishedWork), _error = invokeGuardedCallback$1(null, commitAllHostEffects, null), null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."),
null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."),
captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect));
} }
for (stopCommitHostEffectsTimer(), resetAfterCommit(commitInfo), root.current = finishedWork, for (stopCommitHostEffectsTimer(), resetAfterCommit(), root.current = finishedWork,
nextEffect = firstEffect, startCommitLifeCyclesTimer(); null !== nextEffect; ) { nextEffect = firstEffect, startCommitLifeCyclesTimer(); null !== nextEffect; ) {
var _error2 = null; var _error2 = null;
_error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null, finishedWork), _error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null), null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."),
null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."),
captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect));
} }
isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode),
@ -3327,10 +3347,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress), if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress),
!0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
next; next;
if (null !== returnFiber && (null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), if (null !== returnFiber) {
null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect),
null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect),
returnFiber.lastEffect = workInProgress.lastEffect), workInProgress.effectTag !== NoEffect$2 && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, returnFiber.lastEffect = workInProgress.lastEffect);
returnFiber.lastEffect = workInProgress)), stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress,
returnFiber.lastEffect = workInProgress);
}
if (stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
null !== siblingFiber) return siblingFiber; null !== siblingFiber) return siblingFiber;
if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress,
null; null;
@ -3364,16 +3388,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork());
} }
function workLoop(priorityLevel, deadline) { function workLoop(priorityLevel, deadline) {
clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()),
var hostRootTimeMarker = void 0; null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit),
if (ReactFeatureFlags_1.logTopLevelRenders && null !== nextUnitOfWork && nextUnitOfWork.tag === HostRoot$4 && null !== nextUnitOfWork.child) {
hostRootTimeMarker = "React update: " + (getComponentName_1(nextUnitOfWork.child) || ""),
console.time(hostRootTimeMarker);
}
if (null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit),
nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(),
clearErrors()); clearErrors());
hostRootTimeMarker && console.timeEnd(hostRootTimeMarker);
} }
function performWork(priorityLevel, deadline) { function performWork(priorityLevel, deadline) {
startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."),
@ -3435,9 +3453,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
if (null !== boundary) { if (null !== boundary) {
null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary);
var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName2 = getComponentName_1(failedWork); var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName = getComponentName_1(failedWork);
return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, {
componentName: _componentName2, componentName: _componentName,
componentStack: _componentStack, componentStack: _componentStack,
error: error, error: error,
errorBoundary: errorBoundaryFound ? boundary.stateNode : null, errorBoundary: errorBoundaryFound ? boundary.stateNode : null,
@ -3488,7 +3506,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
popContextProvider$1(node); popContextProvider$1(node);
break; break;
case HostComponent$5: case HostComponent$6:
popHostContext(node); popHostContext(node);
break; break;
@ -3609,7 +3627,7 @@ getContextForSubtree._injectFiber = function(fn) {
getContextFiber = fn; getContextFiber = fn;
}; };
var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber;
getContextForSubtree_1._injectFiber(function(fiber) { getContextForSubtree_1._injectFiber(function(fiber) {
var parentContext = findCurrentUnmaskedContext(fiber); var parentContext = findCurrentUnmaskedContext(fiber);
@ -3617,7 +3635,7 @@ getContextForSubtree_1._injectFiber(function(fiber) {
}); });
var ReactFiberReconciler = function(config) { var ReactFiberReconciler = function(config) {
var _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates;
function scheduleTopLevelUpdate(current, element, callback) { function scheduleTopLevelUpdate(current, element, callback) {
"render" === ReactDebugCurrentFiber.phase && null !== ReactDebugCurrentFiber.current && warning$2(!1, "Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentName(ReactDebugCurrentFiber.current) || "Unknown"); "render" === ReactDebugCurrentFiber.phase && null !== ReactDebugCurrentFiber.current && warning$2(!1, "Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentName(ReactDebugCurrentFiber.current) || "Unknown");
var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = {
@ -3644,7 +3662,14 @@ var ReactFiberReconciler = function(config) {
deferredUpdates: deferredUpdates, deferredUpdates: deferredUpdates,
getPublicRootInstance: function(container) { getPublicRootInstance: function(container) {
var containerFiber = container.current; var containerFiber = container.current;
return containerFiber.child ? containerFiber.child.stateNode : null; if (!containerFiber.child) return null;
switch (containerFiber.child.tag) {
case HostComponent$1:
return getPublicInstance(containerFiber.child.stateNode);
default:
return containerFiber.child.stateNode;
}
}, },
findHostInstance: function(fiber) { findHostInstance: function(fiber) {
var hostFiber = findCurrentHostFiber(fiber); var hostFiber = findCurrentHostFiber(fiber);
@ -3820,16 +3845,15 @@ var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, warnForStyleP
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes);
UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload);
}, ReactNativeFiberHostComponent; }, ReactNativeFiberHostComponent;
}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), prefix = "topsecret-", ReactNativeViewConfigRegistry = { }(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = {
register: function(viewConfig) { register: function(viewConfig) {
var name = viewConfig.uiViewClassName; var name = viewConfig.uiViewClassName;
invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name); return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name),
var secretName = prefix + name; viewConfigs.set(name, viewConfig), name;
return viewConfigs.set(secretName, viewConfig), secretName;
}, },
get: function(secretName) { get: function(name) {
var config = viewConfigs.get(secretName); var config = viewConfigs.get(name);
return invariant(config, "View config not found for name %s", secretName), config; return invariant(config, "View config not found for name %s", name), config;
} }
}, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; }, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps;
@ -3924,11 +3948,11 @@ var NativeRenderer = ReactFiberReconciler({
}, },
scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame,
scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, scheduleDeferredCallback: commonjsGlobal.requestIdleCallback,
shouldSetTextContent: function(props) { shouldSetTextContent: function(type, props) {
return !1; return !1;
}, },
useSyncScheduling: !0 useSyncScheduling: !0
}), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$10 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { }), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$11 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) {
instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._debugOwner)); instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._debugOwner));
}, getOwnerHierarchy = function(instance) { }, getOwnerHierarchy = function(instance) {
var hierarchy = []; var hierarchy = [];
@ -3936,7 +3960,7 @@ var NativeRenderer = ReactFiberReconciler({
}, lastNonHostInstance = function(hierarchy) { }, lastNonHostInstance = function(hierarchy) {
for (var i = hierarchy.length - 1; i > 1; i--) { for (var i = hierarchy.length - 1; i > 1; i--) {
var instance = hierarchy[i]; var instance = hierarchy[i];
if (instance.tag !== HostComponent$10) return instance; if (instance.tag !== HostComponent$11) return instance;
} }
return hierarchy[0]; return hierarchy[0];
}, getHostProps = function(fiber) { }, getHostProps = function(fiber) {
@ -3944,17 +3968,15 @@ var NativeRenderer = ReactFiberReconciler({
return host ? host.memoizedProps || emptyObject : emptyObject; return host ? host.memoizedProps || emptyObject : emptyObject;
}, getHostNode = function(fiber, findNodeHandle) { }, getHostNode = function(fiber, findNodeHandle) {
for (var hostNode = void 0; fiber; ) { for (var hostNode = void 0; fiber; ) {
if (null !== fiber.stateNode && fiber.tag === HostComponent$10 && (hostNode = findNodeHandle(fiber.stateNode)), if (null !== fiber.stateNode && fiber.tag === HostComponent$11 && (hostNode = findNodeHandle(fiber.stateNode)),
hostNode) return hostNode; hostNode) return hostNode;
fiber = fiber.child; fiber = fiber.child;
} }
return null; return null;
}, stripTopSecret = function(str) {
return "string" == typeof str && str.replace("topsecret-", "");
}, createHierarchy = function(fiberHierarchy) { }, createHierarchy = function(fiberHierarchy) {
return fiberHierarchy.map(function(fiber) { return fiberHierarchy.map(function(fiber) {
return { return {
name: stripTopSecret(getComponentName_1(fiber)), name: getComponentName_1(fiber),
getInspectorData: function(findNodeHandle) { getInspectorData: function(findNodeHandle) {
return { return {
measure: function(callback) { measure: function(callback) {
@ -3972,7 +3994,6 @@ getInspectorDataForViewTag = function(viewTag) {
var fiber = findCurrentFiberUsingSlowPath$1(getClosestInstanceFromNode(viewTag)), fiberHierarchy = getOwnerHierarchy(fiber), instance = lastNonHostInstance(fiberHierarchy), hierarchy = createHierarchy(fiberHierarchy), props = getHostProps(instance), source = instance._debugSource; var fiber = findCurrentFiberUsingSlowPath$1(getClosestInstanceFromNode(viewTag)), fiberHierarchy = getOwnerHierarchy(fiber), instance = lastNonHostInstance(fiberHierarchy), hierarchy = createHierarchy(fiberHierarchy), props = getHostProps(instance), source = instance._debugSource;
return { return {
hierarchy: hierarchy, hierarchy: hierarchy,
instance: instance,
props: props, props: props,
selection: fiberHierarchy.indexOf(instance), selection: fiberHierarchy.indexOf(instance),
source: source source: source
@ -4005,28 +4026,99 @@ function findNodeHandle(componentOrHandle) {
var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) {
var instance = findNodeHandle_1(componentOrHandle); var instance = findNodeHandle_1(componentOrHandle);
return null == instance || "number" == typeof instance ? instance : instance._nativeTag; return null == instance || "number" == typeof instance ? instance : instance._nativeTag;
}, DevOnlyStubShim = null, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { }, DevOnlyStubShim = null;
measure: function(callback) {
function _classCallCheck$2(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _possibleConstructorReturn(self, call) {
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !call || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) {
_inherits(ReactNativeComponent, _React$Component);
function ReactNativeComponent() {
return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return ReactNativeComponent.prototype.blur = function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.focus = function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.measure = function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback));
}, ReactNativeComponent.prototype.measureInWindow = function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback));
}, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess));
}, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
}, ReactNativeComponent;
}(react.Component);
function setNativePropsFiber(componentOrHandle, nativeProps) {
var maybeInstance = void 0;
try {
maybeInstance = findNodeHandle_1(componentOrHandle);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload);
}
}
function setNativePropsStack(componentOrHandle, nativeProps) {
var maybeInstance = findNodeHandle_1(componentOrHandle);
if (null != maybeInstance) {
var viewConfig = void 0;
if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else {
for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent;
viewConfig = maybeInstance.viewConfig;
}
var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload);
}
}
var injectedSetNativeProps = void 0;
injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack;
var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback));
}, },
measureInWindow: function(callback) { measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback));
}, },
measureLayout: function(relativeToNativeNode, onSuccess, onFail) { measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess));
}, },
setNativeProps: function(nativeProps) { setNativeProps: function(nativeProps) {
injectedSetNativeProps(this, nativeProps); injectedSetNativeProps$1(this, nativeProps);
}, },
focus: function() { focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle(this)); TextInputState.focusTextInput(findNumericNodeHandle$1(this));
}, },
blur: function() { blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle(this)); TextInputState.blurTextInput(findNumericNodeHandle$1(this));
} }
}; };
function setNativePropsFiber(componentOrHandle, nativeProps) { function setNativePropsFiber$1(componentOrHandle, nativeProps) {
var maybeInstance = void 0; var maybeInstance = void 0;
try { try {
maybeInstance = findNodeHandle_1(componentOrHandle); maybeInstance = findNodeHandle_1(componentOrHandle);
@ -4039,7 +4131,7 @@ function setNativePropsFiber(componentOrHandle, nativeProps) {
} }
} }
function setNativePropsStack(componentOrHandle, nativeProps) { function setNativePropsStack$1(componentOrHandle, nativeProps) {
var maybeInstance = findNodeHandle_1(componentOrHandle); var maybeInstance = findNodeHandle_1(componentOrHandle);
if (null != maybeInstance) { if (null != maybeInstance) {
var viewConfig = void 0; var viewConfig = void 0;
@ -4054,9 +4146,9 @@ function setNativePropsStack(componentOrHandle, nativeProps) {
} }
} }
var injectedSetNativeProps = void 0; var injectedSetNativeProps$1 = void 0;
injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1;
var NativeMethodsMixin_DEV = NativeMethodsMixin; var NativeMethodsMixin_DEV = NativeMethodsMixin;
@ -4102,10 +4194,10 @@ var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = {
noCentroid: -1 noCentroid: -1
}, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) {
return ReactNativeViewConfigRegistry_1.register(viewConfig); return ReactNativeViewConfigRegistry_1.register(viewConfig);
}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; }, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim;
function takeSnapshot(view, options) { function takeSnapshot(view, options) {
return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"),
UIManager.__takeSnapshot(view, options); UIManager.__takeSnapshot(view, options);
} }
@ -4577,6 +4669,7 @@ var roots = new Map();
ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog);
var ReactNative = { var ReactNative = {
NativeComponent: ReactNativeComponent_1,
findNodeHandle: findNumericNodeHandleFiber, findNodeHandle: findNumericNodeHandleFiber,
render: function(element, containerTag, callback) { render: function(element, containerTag, callback) {
var root = roots.get(containerTag); var root = roots.get(containerTag);

View File

@ -23,7 +23,7 @@ var emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), sha
require("deepFreezeAndThrowOnMutationInDev"), require("ReactNativeFeatureFlags"); require("deepFreezeAndThrowOnMutationInDev"), require("ReactNativeFeatureFlags");
var defaultShowDialog = function() { var defaultShowDialog = function(capturedError) {
return !0; return !0;
}, showDialog = defaultShowDialog; }, showDialog = defaultShowDialog;
@ -1020,20 +1020,19 @@ var ReactNativeInjection = {
isPortal: isPortal, isPortal: isPortal,
REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1
}, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { }, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = {
logTopLevelRenders: !1,
prepareNewChildrenBeforeUnmountInStack: !0,
disableNewFiberFeatures: !1, disableNewFiberFeatures: !1,
enableAsyncSubtreeAPI: !1 enableAsyncSubtreeAPI: !1
}, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { }, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = {
NoEffect: 0, NoEffect: 0,
Placement: 1, PerformedWork: 1,
Update: 2, Placement: 2,
PlacementAndUpdate: 3, Update: 4,
Deletion: 4, PlacementAndUpdate: 6,
ContentReset: 8, Deletion: 8,
Callback: 16, ContentReset: 16,
Err: 32, Callback: 32,
Ref: 64 Err: 64,
Ref: 128
}, ReactPriorityLevel = { }, ReactPriorityLevel = {
NoWork: 0, NoWork: 0,
SynchronousPriority: 1, SynchronousPriority: 1,
@ -1247,7 +1246,7 @@ var getComponentName_1 = getComponentName$1, ReactInstanceMap = {
} }
}, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { }, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = {
ReactCurrentOwner: ReactInternals.ReactCurrentOwner ReactCurrentOwner: ReactInternals.ReactCurrentOwner
}, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; }, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3;
function isFiberMountedImpl(fiber) { function isFiberMountedImpl(fiber) {
var node = fiber; var node = fiber;
@ -1324,7 +1323,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent
var currentParent = findCurrentFiberUsingSlowPath(parent); var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) return null; if (!currentParent) return null;
for (var node = currentParent; !0; ) { for (var node = currentParent; !0; ) {
if (node.tag === HostComponent$1 || node.tag === HostText) return node; if (node.tag === HostComponent$2 || node.tag === HostText) return node;
if (node.child) node.child.return = node, node = node.child; else { if (node.child) node.child.return = node, node = node.child; else {
if (node === currentParent) return null; if (node === currentParent) return null;
for (;!node.sibling; ) { for (;!node.sibling; ) {
@ -1458,7 +1457,7 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio
}, ReactTypeOfInternalContext = { }, ReactTypeOfInternalContext = {
NoContext: 0, NoContext: 0,
AsyncUpdates: 1 AsyncUpdates: 1
}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, createFiber = function(tag, key, internalContextTag) { }, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, createFiber = function(tag, key, internalContextTag) {
return { return {
tag: tag, tag: tag,
key: key, key: key,
@ -1520,7 +1519,7 @@ var cloneFiber = function(fiber, priorityLevel) {
function createFiberFromElementType(type, key, internalContextTag, debugOwner) { function createFiberFromElementType(type, key, internalContextTag, debugOwner) {
var fiber = void 0; var fiber = void 0;
if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$2, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag), if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$2, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag),
fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$2, key, internalContextTag), fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$3, key, internalContextTag),
fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else {
var info = ""; var info = "";
invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info);
@ -1529,7 +1528,7 @@ function createFiberFromElementType(type, key, internalContextTag, debugOwner) {
} }
var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() {
var fiber = createFiber(HostComponent$2, null, NoContext); var fiber = createFiber(HostComponent$3, null, NoContext);
return fiber.type = "DELETED", fiber; return fiber.type = "DELETED", fiber;
}, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { }, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) {
var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag);
@ -1567,7 +1566,7 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo
return uninitializedFiber.stateNode = root, root; return uninitializedFiber.stateNode = root, root;
}, ReactFiberRoot = { }, ReactFiberRoot = {
createFiberRoot: createFiberRoot$1 createFiberRoot: createFiberRoot$1
}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostComponent$4 = ReactTypeOfWork.HostComponent; }, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostComponent$5 = ReactTypeOfWork.HostComponent;
function describeComponentFrame(name, source, ownerName) { function describeComponentFrame(name, source, ownerName) {
return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : "");
@ -1578,7 +1577,7 @@ function describeFiber(fiber) {
case IndeterminateComponent$1: case IndeterminateComponent$1:
case FunctionalComponent: case FunctionalComponent:
case ClassComponent$4: case ClassComponent$4:
case HostComponent$4: case HostComponent$5:
var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null;
return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName);
@ -1636,7 +1635,7 @@ function getIteratorFn(maybeIterable) {
if ("function" == typeof iteratorFn) return iteratorFn; if ("function" == typeof iteratorFn) return iteratorFn;
} }
var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$3 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion;
function coerceRef(current, element) { function coerceRef(current, element) {
var mixedRef = element.ref; var mixedRef = element.ref;
@ -1693,7 +1692,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
var clone = cloneFiber$2(fiber, priority); var clone = cloneFiber$2(fiber, priority);
return clone.index = 0, clone.sibling = null, clone; return clone.index = 0, clone.sibling = null, clone;
} }
return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$3, fiber.index = 0, return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0,
fiber.sibling = null, fiber; fiber.sibling = null, fiber;
} }
function placeChild(newFiber, lastPlacedIndex, newIndex) { function placeChild(newFiber, lastPlacedIndex, newIndex) {
@ -2147,7 +2146,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
resumeMountClassInstance: resumeMountClassInstance, resumeMountClassInstance: resumeMountClassInstance,
updateClassInstance: updateClassInstance updateClassInstance: updateClassInstance
}; };
}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { }, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) {
var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance;
function markChildAsProgressed(current, workInProgress, priorityLevel) { function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
@ -2186,8 +2185,9 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
bailoutOnAlreadyFinishedWork(current, workInProgress); bailoutOnAlreadyFinishedWork(current, workInProgress);
} }
var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext);
return nextChildren = fn(nextProps, context), reconcileChildren(current, workInProgress, nextChildren), return nextChildren = fn(nextProps, context), workInProgress.effectTag |= PerformedWork$1,
memoizeProps(workInProgress, nextProps), workInProgress.child; reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps),
workInProgress.child;
} }
function updateClassComponent(current, workInProgress, priorityLevel) { function updateClassComponent(current, workInProgress, priorityLevel) {
var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0;
@ -2200,9 +2200,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
var instance = workInProgress.stateNode; var instance = workInProgress.stateNode;
ReactCurrentOwner$2.current = workInProgress; ReactCurrentOwner$2.current = workInProgress;
var nextChildren = void 0; var nextChildren = void 0;
return nextChildren = instance.render(), reconcileChildren(current, workInProgress, nextChildren), return nextChildren = instance.render(), workInProgress.effectTag |= PerformedWork$1,
memoizeState(workInProgress, instance.state), memoizeProps(workInProgress, instance.props), reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state),
hasContext && invalidateContextProvider$1(workInProgress), workInProgress.child; memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress),
workInProgress.child;
} }
function updateHostRoot(current, workInProgress, priorityLevel) { function updateHostRoot(current, workInProgress, priorityLevel) {
var root = workInProgress.stateNode; var root = workInProgress.stateNode;
@ -2214,17 +2215,18 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
var element = state.element; var element = state.element;
return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(),
reconcileChildren(current, workInProgress, element), memoizeState(workInProgress, state), reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2,
workInProgress.child) : (workInProgress.effectTag |= Placement$2, workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel),
markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child); markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state),
workInProgress.child;
} }
return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress);
} }
function updateHostComponent(current, workInProgress) { function updateHostComponent(current, workInProgress) {
pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress);
var nextProps = workInProgress.pendingProps, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps;
if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) {
if (!useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1,
child = child.sibling; child = child.sibling;
return null; return null;
@ -2232,7 +2234,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
return bailoutOnAlreadyFinishedWork(current, workInProgress); return bailoutOnAlreadyFinishedWork(current, workInProgress);
} }
var nextChildren = nextProps.children; var nextChildren = nextProps.children;
if (shouldSetTextContent(nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(prevProps) && (workInProgress.effectTag |= ContentReset$1), if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1),
markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) {
if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild),
reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1),
@ -2253,7 +2255,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
function mountIndeterminateComponent(current, workInProgress, priorityLevel) { function mountIndeterminateComponent(current, workInProgress, priorityLevel) {
invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue.");
var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext);
if ("object" == typeof (value = fn(props, context)) && null !== value && "function" == typeof value.render) { if (value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, "object" == typeof value && null !== value && "function" == typeof value.render) {
workInProgress.tag = ClassComponent$5; workInProgress.tag = ClassComponent$5;
var hasContext = pushContextProvider$1(workInProgress); var hasContext = pushContextProvider$1(workInProgress);
return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel),
@ -2321,7 +2323,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
case HostRoot$4: case HostRoot$4:
return updateHostRoot(current, workInProgress, priorityLevel); return updateHostRoot(current, workInProgress, priorityLevel);
case HostComponent$5: case HostComponent$6:
return updateHostComponent(current, workInProgress); return updateHostComponent(current, workInProgress);
case HostText$2: case HostText$2:
@ -2361,8 +2363,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
beginWork: beginWork, beginWork: beginWork,
beginFailedWork: beginFailedWork beginFailedWork: beginFailedWork
}; };
}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { }, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) {
var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, hydrateHostInstance = hydrationContext.hydrateHostInstance, hydrateHostTextInstance = hydrationContext.hydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState;
function markChildAsProgressed(current, workInProgress, priorityLevel) { function markChildAsProgressed(current, workInProgress, priorityLevel) {
workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel,
null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority);
@ -2376,7 +2378,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
function appendAllYields(yields, workInProgress) { function appendAllYields(yields, workInProgress) {
var node = workInProgress.stateNode; var node = workInProgress.stateNode;
for (node && (node.return = workInProgress); null !== node; ) { for (node && (node.return = workInProgress); null !== node; ) {
if (node.tag === HostComponent$6 || node.tag === HostText$4 || node.tag === HostPortal$4) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$3) yields.push(node.type); else if (null !== node.child) { if (node.tag === HostComponent$7 || node.tag === HostText$4 || node.tag === HostPortal$4) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$3) yields.push(node.type); else if (null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
continue; continue;
} }
@ -2399,7 +2401,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} }
function appendAllChildren(parent, workInProgress) { function appendAllChildren(parent, workInProgress) {
for (var node = workInProgress.child; null !== node; ) { for (var node = workInProgress.child; null !== node; ) {
if (node.tag === HostComponent$6 || node.tag === HostText$4) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$4) ; else if (null !== node.child) { if (node.tag === HostComponent$7 || node.tag === HostText$4) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$4) ; else if (null !== node.child) {
node = node.child; node = node.child;
continue; continue;
} }
@ -2425,7 +2427,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress),
workInProgress.effectTag &= ~Placement$4), null; workInProgress.effectTag &= ~Placement$4), null;
case HostComponent$6: case HostComponent$7:
popHostContext(workInProgress); popHostContext(workInProgress);
var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps;
if (null !== current && null != workInProgress.stateNode) { if (null !== current && null != workInProgress.stateNode) {
@ -2435,10 +2437,13 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} else { } else {
if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."),
null; null;
var _currentHostContext = getHostContext(), _instance = void 0; var _currentHostContext = getHostContext();
popHydrationState(workInProgress) ? _instance = hydrateHostInstance(workInProgress, rootContainerInstance) : (_instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress), if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else {
appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress)), var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress);
workInProgress.stateNode = _instance, null !== workInProgress.ref && markRef(workInProgress); appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress),
workInProgress.stateNode = _instance;
}
null !== workInProgress.ref && markRef(workInProgress);
} }
return null; return null;
@ -2449,9 +2454,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac
} else { } else {
if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."),
null; null;
var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(), textInstance = void 0; var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext();
textInstance = popHydrationState(workInProgress) ? hydrateHostTextInstance(workInProgress, _rootContainerInstance) : createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress), popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress);
workInProgress.stateNode = textInstance;
} }
return null; return null;
@ -2499,7 +2503,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
injectInternals: injectInternals_1, injectInternals: injectInternals_1,
onCommitRoot: onCommitRoot_1, onCommitRoot: onCommitRoot_1,
onCommitUnmount: onCommitUnmount_1 onCommitUnmount: onCommitUnmount_1
}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) { }, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) {
var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance; var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance;
function safelyCallComponentWillUnmount(current, instance) { function safelyCallComponentWillUnmount(current, instance) {
try { try {
@ -2521,7 +2525,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function getHostParent(fiber) { function getHostParent(fiber) {
for (var parent = fiber.return; null !== parent; ) { for (var parent = fiber.return; null !== parent; ) {
switch (parent.tag) { switch (parent.tag) {
case HostComponent$7: case HostComponent$8:
return parent.stateNode; return parent.stateNode;
case HostRoot$6: case HostRoot$6:
@ -2540,7 +2544,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue.");
} }
function isHostParent(fiber) { function isHostParent(fiber) {
return fiber.tag === HostComponent$7 || fiber.tag === HostRoot$6 || fiber.tag === HostPortal$5; return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$6 || fiber.tag === HostPortal$5;
} }
function getHostSibling(fiber) { function getHostSibling(fiber) {
var node = fiber; var node = fiber;
@ -2549,7 +2553,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
if (null === node.return || isHostParent(node.return)) return null; if (null === node.return || isHostParent(node.return)) return null;
node = node.return; node = node.return;
} }
for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$7 && node.tag !== HostText$5; ) { for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$8 && node.tag !== HostText$5; ) {
if (node.effectTag & Placement$5) continue siblings; if (node.effectTag & Placement$5) continue siblings;
if (null === node.child || node.tag === HostPortal$5) continue siblings; if (null === node.child || node.tag === HostPortal$5) continue siblings;
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
@ -2560,7 +2564,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function commitPlacement(finishedWork) { function commitPlacement(finishedWork) {
var parentFiber = getHostParentFiber(finishedWork), parent = void 0; var parentFiber = getHostParentFiber(finishedWork), parent = void 0;
switch (parentFiber.tag) { switch (parentFiber.tag) {
case HostComponent$7: case HostComponent$8:
parent = parentFiber.stateNode; parent = parentFiber.stateNode;
break; break;
@ -2574,7 +2578,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2);
for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) {
if (node.tag === HostComponent$7 || node.tag === HostText$5) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { if (node.tag === HostComponent$8 || node.tag === HostText$5) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
continue; continue;
} }
@ -2598,7 +2602,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
function unmountHostComponents(parent, current) { function unmountHostComponents(parent, current) {
for (var node = current; !0; ) { for (var node = current; !0; ) {
if (node.tag === HostComponent$7 || node.tag === HostText$5) commitNestedUnmounts(node), if (node.tag === HostComponent$8 || node.tag === HostText$5) commitNestedUnmounts(node),
removeChild(parent, node.stateNode); else if (node.tag === HostPortal$5) { removeChild(parent, node.stateNode); else if (node.tag === HostPortal$5) {
if (parent = node.stateNode.containerInfo, null !== node.child) { if (parent = node.stateNode.containerInfo, null !== node.child) {
node.child.return = node, node = node.child; node.child.return = node, node = node.child;
@ -2627,7 +2631,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var instance = current.stateNode; var instance = current.stateNode;
return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance));
case HostComponent$7: case HostComponent$8:
return void safelyDetachRef(current); return void safelyDetachRef(current);
case CoroutineComponent$4: case CoroutineComponent$4:
@ -2642,17 +2646,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
case ClassComponent$8: case ClassComponent$8:
return; return;
case HostComponent$7: case HostComponent$8:
var instance = finishedWork.stateNode; var instance = finishedWork.stateNode;
if (null != instance && null !== current) { if (null != instance) {
var newProps = finishedWork.memoizedProps, oldProps = current.memoizedProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue;
finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
} }
return; return;
case HostText$5: case HostText$5:
invariant(null !== finishedWork.stateNode && null !== current, "This should only be done during updates. This error is likely " + "caused by a bug in React. Please file an issue."); invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue.");
var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = current.memoizedProps; var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText;
return void commitTextUpdate(textInstance, oldText, newText); return void commitTextUpdate(textInstance, oldText, newText);
case HostRoot$6: case HostRoot$6:
@ -2681,7 +2685,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
return; return;
case HostComponent$7: case HostComponent$8:
var _instance2 = finishedWork.stateNode; var _instance2 = finishedWork.stateNode;
if (null === current && finishedWork.effectTag & Update$3) { if (null === current && finishedWork.effectTag & Update$3) {
var type = finishedWork.type, props = finishedWork.memoizedProps; var type = finishedWork.type, props = finishedWork.memoizedProps;
@ -2700,7 +2704,15 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
function commitAttachRef(finishedWork) { function commitAttachRef(finishedWork) {
var ref = finishedWork.ref; var ref = finishedWork.ref;
if (null !== ref) { if (null !== ref) {
ref(getPublicInstance(finishedWork.stateNode)); var instance = finishedWork.stateNode;
switch (finishedWork.tag) {
case HostComponent$8:
ref(getPublicInstance(instance));
break;
default:
ref(instance);
}
} }
} }
function commitDetachRef(current) { function commitDetachRef(current) {
@ -2755,7 +2767,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
pushHostContext: pushHostContext, pushHostContext: pushHostContext,
resetHostContainer: resetHostContainer resetHostContainer: resetHostContainer
}; };
}, HostComponent$8 = ReactTypeOfWork.HostComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { }, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostRoot$7 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) {
var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance;
if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return {
enterHydrationState: function() { enterHydrationState: function() {
@ -2763,10 +2775,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
}, },
resetHydrationState: function() {}, resetHydrationState: function() {},
tryToClaimNextHydratableInstance: function() {}, tryToClaimNextHydratableInstance: function() {},
hydrateHostInstance: function() { prepareToHydrateHostInstance: function() {
invariant(!1, "React bug."); invariant(!1, "React bug.");
}, },
hydrateHostTextInstance: function() { prepareToHydrateHostTextInstance: function() {
invariant(!1, "React bug."); invariant(!1, "React bug.");
}, },
popHydrationState: function(fiber) { popHydrationState: function(fiber) {
@ -2781,42 +2793,52 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
function deleteHydratableInstance(returnFiber, instance) { function deleteHydratableInstance(returnFiber, instance) {
var childToDelete = createFiberFromHostInstanceForDeletion$1(); var childToDelete = createFiberFromHostInstanceForDeletion$1();
childToDelete.stateNode = instance, childToDelete.return = returnFiber; childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2,
var last = returnFiber.progressedLastDeletion; null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete,
null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete,
childToDelete.effectTag = Deletion$2, null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete,
returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
} }
function canHydrate(fiber, nextInstance) {
switch (fiber.tag) {
case HostComponent$9:
var type = fiber.type, props = fiber.memoizedProps;
return canHydrateInstance(nextInstance, type, props);
case HostText$6:
return canHydrateTextInstance(nextInstance);
default:
return !1;
}
}
function tryToClaimNextHydratableInstance(fiber) { function tryToClaimNextHydratableInstance(fiber) {
if (isHydrating) { if (isHydrating) {
var nextInstance = nextHydratableInstance; var nextInstance = nextHydratableInstance;
if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber);
var type = fiber.type, props = fiber.memoizedProps; if (!canHydrate(fiber, nextInstance)) {
if (!canHydrateInstance(nextInstance, type, props)) { if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6,
if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrateInstance(nextInstance, type, props)) return fiber.effectTag |= Placement$6,
isHydrating = !1, void (hydrationParentFiber = fiber); isHydrating = !1, void (hydrationParentFiber = fiber);
deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance);
} }
fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance);
} }
} }
function hydrateHostInstance(fiber, rootContainerInstance) { function prepareToHydrateHostInstance(fiber, rootContainerInstance) {
var instance = fiber.stateNode; var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber);
return hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber), return fiber.updateQueue = updatePayload, null !== updatePayload;
instance;
} }
function hydrateHostTextInstance(fiber) { function prepareToHydrateHostTextInstance(fiber) {
var textInstance = fiber.stateNode; var textInstance = fiber.stateNode;
return hydrateTextInstance(textInstance, fiber), textInstance; return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber);
} }
function popToNextHostParent(fiber) { function popToNextHostParent(fiber) {
for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$8 && parent.tag !== HostRoot$7; ) parent = parent.return; for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$7; ) parent = parent.return;
hydrationParentFiber = parent; hydrationParentFiber = parent;
} }
function popHydrationState(fiber) { function popHydrationState(fiber) {
if (fiber !== hydrationParentFiber) return !1; if (fiber !== hydrationParentFiber) return !1;
if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1;
if (fiber.tag !== HostComponent$8 || "head" !== fiber.type && "body" !== fiber.type && !shouldSetTextContent(fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), var type = fiber.type;
if (fiber.tag !== HostComponent$9 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance),
nextInstance = getNextHydratableSibling(nextInstance); nextInstance = getNextHydratableSibling(nextInstance);
return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null,
!0; !0;
@ -2828,11 +2850,11 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
enterHydrationState: enterHydrationState, enterHydrationState: enterHydrationState,
resetHydrationState: resetHydrationState, resetHydrationState: resetHydrationState,
tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance,
hydrateHostInstance: hydrateHostInstance, prepareToHydrateHostInstance: prepareToHydrateHostInstance,
hydrateHostTextInstance: hydrateHostTextInstance, prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance,
popHydrationState: popHydrationState popHydrationState: popHydrationState
}; };
}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { }, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) {
var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, hostScheduleAnimationCallback = config.scheduleAnimationCallback, hostScheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isAnimationCallbackScheduled = !1, isDeferredCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, hostScheduleAnimationCallback = config.scheduleAnimationCallback, hostScheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isAnimationCallbackScheduled = !1, isDeferredCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1;
function scheduleAnimationCallback(callback) { function scheduleAnimationCallback(callback) {
isAnimationCallbackScheduled || (isAnimationCallbackScheduled = !0, hostScheduleAnimationCallback(callback)); isAnimationCallbackScheduled || (isAnimationCallbackScheduled = !0, hostScheduleAnimationCallback(callback));
@ -2864,7 +2886,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var current = nextEffect.alternate; var current = nextEffect.alternate;
null !== current && commitDetachRef(current); null !== current && commitDetachRef(current);
} }
switch (effectTag & ~(Callback | Err | ContentReset | Ref)) { switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) {
case Placement$1: case Placement$1:
commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1;
break; break;
@ -2906,23 +2928,22 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var previousPriorityContext = priorityContext; var previousPriorityContext = priorityContext;
priorityContext = TaskPriority$1; priorityContext = TaskPriority$1;
var firstEffect = void 0; var firstEffect = void 0;
finishedWork.effectTag !== NoEffect$2 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork,
firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect; firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect,
var commitInfo = prepareForCommit(); prepareForCommit(), nextEffect = firstEffect; null !== nextEffect; ) {
for (nextEffect = firstEffect; null !== nextEffect; ) {
var _error = null; var _error = null;
try { try {
commitAllHostEffects(finishedWork); commitAllHostEffects();
} catch (e) { } catch (e) {
_error = e; _error = e;
} }
null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."),
captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect));
} }
for (resetAfterCommit(commitInfo), root.current = finishedWork, nextEffect = firstEffect; null !== nextEffect; ) { for (resetAfterCommit(), root.current = finishedWork, nextEffect = firstEffect; null !== nextEffect; ) {
var _error2 = null; var _error2 = null;
try { try {
commitAllLifeCycles(finishedWork); commitAllLifeCycles();
} catch (e) { } catch (e) {
_error2 = e; _error2 = e;
} }
@ -2946,10 +2967,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling; var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling;
if (resetWorkPriority(workInProgress), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), if (resetWorkPriority(workInProgress), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
next; next;
if (null !== returnFiber && (null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), if (null !== returnFiber) {
null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect),
null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect),
returnFiber.lastEffect = workInProgress.lastEffect), workInProgress.effectTag !== NoEffect$2 && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, returnFiber.lastEffect = workInProgress.lastEffect);
returnFiber.lastEffect = workInProgress)), !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress,
returnFiber.lastEffect = workInProgress);
}
if (!1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress),
null !== siblingFiber) return siblingFiber; null !== siblingFiber) return siblingFiber;
if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress,
null; null;
@ -2979,16 +3004,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork());
} }
function workLoop(priorityLevel, deadline) { function workLoop(priorityLevel, deadline) {
clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()),
var hostRootTimeMarker = void 0; null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit),
if (ReactFeatureFlags_1.logTopLevelRenders && null !== nextUnitOfWork && nextUnitOfWork.tag === HostRoot$3 && null !== nextUnitOfWork.child) {
hostRootTimeMarker = "React update: " + (getComponentName_1(nextUnitOfWork.child) || ""),
console.time(hostRootTimeMarker);
}
if (null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit),
nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(),
clearErrors()); clearErrors());
hostRootTimeMarker && console.timeEnd(hostRootTimeMarker);
} }
function performWork(priorityLevel, deadline) { function performWork(priorityLevel, deadline) {
invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."),
@ -3053,9 +3072,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
} }
if (null !== boundary) { if (null !== boundary) {
null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary);
var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork), _componentName2 = getComponentName_1(failedWork); var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork), _componentName = getComponentName_1(failedWork);
return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, {
componentName: _componentName2, componentName: _componentName,
componentStack: _componentStack, componentStack: _componentStack,
error: error, error: error,
errorBoundary: errorBoundaryFound ? boundary.stateNode : null, errorBoundary: errorBoundaryFound ? boundary.stateNode : null,
@ -3106,7 +3125,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo
popContextProvider$1(node); popContextProvider$1(node);
break; break;
case HostComponent$3: case HostComponent$4:
popHostContext(node); popHostContext(node);
break; break;
@ -3223,7 +3242,7 @@ getContextForSubtree._injectFiber = function(fn) {
getContextFiber = fn; getContextFiber = fn;
}; };
var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber;
getContextForSubtree_1._injectFiber(function(fiber) { getContextForSubtree_1._injectFiber(function(fiber) {
var parentContext = findCurrentUnmaskedContext(fiber); var parentContext = findCurrentUnmaskedContext(fiber);
@ -3231,7 +3250,7 @@ getContextForSubtree_1._injectFiber(function(fiber) {
}); });
var ReactFiberReconciler = function(config) { var ReactFiberReconciler = function(config) {
var _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates;
function scheduleTopLevelUpdate(current, element, callback) { function scheduleTopLevelUpdate(current, element, callback) {
var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = {
element: element element: element
@ -3255,7 +3274,14 @@ var ReactFiberReconciler = function(config) {
deferredUpdates: deferredUpdates, deferredUpdates: deferredUpdates,
getPublicRootInstance: function(container) { getPublicRootInstance: function(container) {
var containerFiber = container.current; var containerFiber = container.current;
return containerFiber.child ? containerFiber.child.stateNode : null; if (!containerFiber.child) return null;
switch (containerFiber.child.tag) {
case HostComponent$1:
return getPublicInstance(containerFiber.child.stateNode);
default:
return containerFiber.child.stateNode;
}
}, },
findHostInstance: function(fiber) { findHostInstance: function(fiber) {
var hostFiber = findCurrentHostFiber(fiber); var hostFiber = findCurrentHostFiber(fiber);
@ -3430,16 +3456,15 @@ var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, ReactNativeFi
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes);
UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload);
}, ReactNativeFiberHostComponent; }, ReactNativeFiberHostComponent;
}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), prefix = "topsecret-", ReactNativeViewConfigRegistry = { }(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = {
register: function(viewConfig) { register: function(viewConfig) {
var name = viewConfig.uiViewClassName; var name = viewConfig.uiViewClassName;
invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name); return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name),
var secretName = prefix + name; viewConfigs.set(name, viewConfig), name;
return viewConfigs.set(secretName, viewConfig), secretName;
}, },
get: function(secretName) { get: function(name) {
var config = viewConfigs.get(secretName); var config = viewConfigs.get(name);
return invariant(config, "View config not found for name %s", secretName), config; return invariant(config, "View config not found for name %s", name), config;
} }
}, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; }, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps;
@ -3532,7 +3557,7 @@ var NativeRenderer = ReactFiberReconciler({
}, },
scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame,
scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, scheduleDeferredCallback: commonjsGlobal.requestIdleCallback,
shouldSetTextContent: function(props) { shouldSetTextContent: function(type, props) {
return !1; return !1;
}, },
useSyncScheduling: !0 useSyncScheduling: !0
@ -3566,26 +3591,48 @@ function findNodeHandle(componentOrHandle) {
var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) {
var instance = findNodeHandle_1(componentOrHandle); var instance = findNodeHandle_1(componentOrHandle);
return null == instance || "number" == typeof instance ? instance : instance._nativeTag; return null == instance || "number" == typeof instance ? instance : instance._nativeTag;
}, DevOnlyStubShim = null, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { }, DevOnlyStubShim = null;
measure: function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); function _classCallCheck$2(instance, Constructor) {
}, if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
measureInWindow: function(callback) { }
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback));
}, function _possibleConstructorReturn(self, call) {
measureLayout: function(relativeToNativeNode, onSuccess, onFail) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); return !call || "object" != typeof call && "function" != typeof call ? self : call;
}, }
setNativeProps: function(nativeProps) {
injectedSetNativeProps(this, nativeProps); function _inherits(subClass, superClass) {
}, if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
focus: function() { subClass.prototype = Object.create(superClass && superClass.prototype, {
TextInputState.focusTextInput(findNumericNodeHandle(this)); constructor: {
}, value: subClass,
blur: function() { enumerable: !1,
TextInputState.blurTextInput(findNumericNodeHandle(this)); writable: !0,
configurable: !0
} }
}; }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) {
_inherits(ReactNativeComponent, _React$Component);
function ReactNativeComponent() {
return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return ReactNativeComponent.prototype.blur = function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.focus = function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.measure = function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback));
}, ReactNativeComponent.prototype.measureInWindow = function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback));
}, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess));
}, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
}, ReactNativeComponent;
}(react.Component);
function setNativePropsFiber(componentOrHandle, nativeProps) { function setNativePropsFiber(componentOrHandle, nativeProps) {
var maybeInstance = void 0; var maybeInstance = void 0;
@ -3615,6 +3662,55 @@ var injectedSetNativeProps = void 0;
injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack;
var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback));
},
measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback));
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess));
},
setNativeProps: function(nativeProps) {
injectedSetNativeProps$1(this, nativeProps);
},
focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle$1(this));
},
blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle$1(this));
}
};
function setNativePropsFiber$1(componentOrHandle, nativeProps) {
var maybeInstance = void 0;
try {
maybeInstance = findNodeHandle_1(componentOrHandle);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload);
}
}
function setNativePropsStack$1(componentOrHandle, nativeProps) {
var maybeInstance = findNodeHandle_1(componentOrHandle);
if (null != maybeInstance) {
var viewConfig = void 0;
if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else {
for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent;
viewConfig = maybeInstance.viewConfig;
}
var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload);
}
}
var injectedSetNativeProps$1 = void 0;
injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1;
var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = {
centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
@ -3650,10 +3746,10 @@ var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = {
noCentroid: -1 noCentroid: -1
}, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) {
return ReactNativeViewConfigRegistry_1.register(viewConfig); return ReactNativeViewConfigRegistry_1.register(viewConfig);
}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; }, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim;
function takeSnapshot(view, options) { function takeSnapshot(view, options) {
return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"),
UIManager.__takeSnapshot(view, options); UIManager.__takeSnapshot(view, options);
} }
@ -3666,6 +3762,7 @@ var roots = new Map();
ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog);
var ReactNative = { var ReactNative = {
NativeComponent: ReactNativeComponent_1,
findNodeHandle: findNumericNodeHandleFiber, findNodeHandle: findNumericNodeHandleFiber,
render: function(element, containerTag, callback) { render: function(element, containerTag, callback) {
var root = roots.get(containerTag); var root = roots.get(containerTag);

View File

@ -1369,12 +1369,7 @@ var ReactReconciler = {
set: function(key, value) { set: function(key, value) {
key._reactInternalInstance = value; key._reactInternalInstance = value;
} }
}, ReactInstanceMap_1 = ReactInstanceMap, ReactFeatureFlags = { }, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = {
logTopLevelRenders: !1,
prepareNewChildrenBeforeUnmountInStack: !0,
disableNewFiberFeatures: !1,
enableAsyncSubtreeAPI: !1
}, ReactFeatureFlags_1 = ReactFeatureFlags, OBSERVED_ERROR = {}, TransactionImpl = {
reinitializeTransaction: function() { reinitializeTransaction: function() {
this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [],
this._isInTransaction = !1; this._isInTransaction = !1;
@ -1474,14 +1469,8 @@ function runBatchedUpdates(transaction) {
invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length),
dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; dirtyComponents.sort(mountOrderComparator), updateBatchNumber++;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
var markerName, component = dirtyComponents[i]; var component = dirtyComponents[i];
if (ReactFeatureFlags_1.logTopLevelRenders) { ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
var namedComponent = component;
component._currentElement.type.isReactTopLevelWrapper && (namedComponent = component._renderedComponent),
markerName = "React update: " + namedComponent.getName(), console.time(markerName);
}
ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber),
markerName && console.timeEnd(markerName);
} }
} }
@ -1857,15 +1846,12 @@ var nextMountID = 1, ReactCompositeComponent = {
_updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) {
var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement, debugID = 0; var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement, debugID = 0;
if (debugID = this._debugID, shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { if (debugID = this._debugID, shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else {
var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance); var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement);
ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack || ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1);
var nodeType = ReactNodeTypes_1.getType(nextRenderedElement);
this._renderedNodeType = nodeType; this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY);
this._renderedComponent = child; this._renderedComponent = child;
var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
if (ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), if (ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), 0 !== debugID) {
0 !== debugID) {
var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : [];
ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
} }
@ -2334,7 +2320,6 @@ getInspectorDataForViewTag = function(viewTag) {
var component = ReactNativeComponentTree_1.getClosestInstanceFromNode(viewTag), componentHierarchy = getOwnerHierarchy(component), instance = lastNotNativeInstance(componentHierarchy), hierarchy = createHierarchy(componentHierarchy), props = getHostProps(instance), source = instance._currentElement && instance._currentElement._source; var component = ReactNativeComponentTree_1.getClosestInstanceFromNode(viewTag), componentHierarchy = getOwnerHierarchy(component), instance = lastNotNativeInstance(componentHierarchy), hierarchy = createHierarchy(componentHierarchy), props = getHostProps(instance), source = instance._currentElement && instance._currentElement._source;
return { return {
hierarchy: hierarchy, hierarchy: hierarchy,
instance: instance,
props: props, props: props,
selection: componentHierarchy.indexOf(instance), selection: componentHierarchy.indexOf(instance),
source: source source: source
@ -2348,13 +2333,13 @@ var ReactNativeStackInspector = {
return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode();
}; };
function _classCallCheck$1(instance, Constructor) { function _classCallCheck$2(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
} }
var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() {
function ReactNativePropRegistry() { function ReactNativePropRegistry() {
_classCallCheck$1(this, ReactNativePropRegistry); _classCallCheck$2(this, ReactNativePropRegistry);
} }
return ReactNativePropRegistry.register = function(object) { return ReactNativePropRegistry.register = function(object) {
var id = ++uniqueID; var id = ++uniqueID;
@ -2473,7 +2458,7 @@ function mountSafeCallback$1(context, callback) {
}; };
} }
function throwOnStylesProp$1(component, props) { function throwOnStylesProp(component, props) {
if (void 0 !== props.styles) { if (void 0 !== props.styles) {
var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?";
throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."),
@ -2481,44 +2466,64 @@ function throwOnStylesProp$1(component, props) {
} }
} }
function warnForStyleProps$1(props, validAttributes) { function warnForStyleProps(props, validAttributes) {
for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`");
} }
var NativeMethodsMixinUtils = { var NativeMethodsMixinUtils = {
mountSafeCallback: mountSafeCallback$1, mountSafeCallback: mountSafeCallback$1,
throwOnStylesProp: throwOnStylesProp$1, throwOnStylesProp: throwOnStylesProp,
warnForStyleProps: warnForStyleProps$1 warnForStyleProps: warnForStyleProps
}, mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback));
},
measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback));
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess));
},
setNativeProps: function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
},
focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
},
blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}
}; };
function _classCallCheck$1(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _possibleConstructorReturn(self, call) {
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !call || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) {
_inherits(ReactNativeComponent, _React$Component);
function ReactNativeComponent() {
return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return ReactNativeComponent.prototype.blur = function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.focus = function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.measure = function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback));
}, ReactNativeComponent.prototype.measureInWindow = function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback));
}, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess));
}, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
}, ReactNativeComponent;
}(React.Component);
function setNativePropsFiber(componentOrHandle, nativeProps) { function setNativePropsFiber(componentOrHandle, nativeProps) {
var maybeInstance = void 0; var maybeInstance = void 0;
try { try {
maybeInstance = findNodeHandle_1(componentOrHandle); maybeInstance = findNodeHandle_1(componentOrHandle);
} catch (error) {} } catch (error) {}
if (null != maybeInstance) { if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig; var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
warnForStyleProps(nativeProps, viewConfig.validAttributes);
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload);
} }
} }
@ -2531,9 +2536,7 @@ function setNativePropsStack(componentOrHandle, nativeProps) {
for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent;
viewConfig = maybeInstance.viewConfig; viewConfig = maybeInstance.viewConfig;
} }
var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
warnForStyleProps(nativeProps, viewConfig.validAttributes);
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload);
} }
} }
@ -2542,13 +2545,66 @@ var injectedSetNativeProps = void 0;
injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack;
var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$1 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback));
},
measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback));
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess));
},
setNativeProps: function(nativeProps) {
injectedSetNativeProps$1(this, nativeProps);
},
focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle$1(this));
},
blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle$1(this));
}
};
function setNativePropsFiber$1(componentOrHandle, nativeProps) {
var maybeInstance = void 0;
try {
maybeInstance = findNodeHandle_1(componentOrHandle);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig;
warnForStyleProps$1(nativeProps, viewConfig.validAttributes);
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload);
}
}
function setNativePropsStack$1(componentOrHandle, nativeProps) {
var maybeInstance = findNodeHandle_1(componentOrHandle);
if (null != maybeInstance) {
var viewConfig = void 0;
if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else {
for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent;
viewConfig = maybeInstance.viewConfig;
}
var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID;
warnForStyleProps$1(nativeProps, viewConfig.validAttributes);
var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload);
}
}
var injectedSetNativeProps$1 = void 0;
injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1;
var NativeMethodsMixin_DEV = NativeMethodsMixin; var NativeMethodsMixin_DEV = NativeMethodsMixin;
invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."),
NativeMethodsMixin_DEV.componentWillMount = function() { NativeMethodsMixin_DEV.componentWillMount = function() {
throwOnStylesProp(this, this.props); throwOnStylesProp$1(this, this.props);
}, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { }, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) {
throwOnStylesProp(this, newProps); throwOnStylesProp$1(this, newProps);
}; };
var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = {
@ -2676,12 +2732,10 @@ var ReactChildReconciler = {
var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name];
if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context),
nextChildren[name] = prevChild; else { nextChildren[name] = prevChild; else {
!ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild),
ReactReconciler_1.unmountComponent(prevChild, !1, !1));
var nextChildInstance = instantiateReactComponent_1(nextElement, !0); var nextChildInstance = instantiateReactComponent_1(nextElement, !0);
nextChildren[name] = nextChildInstance; nextChildren[name] = nextChildInstance;
var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
mountImages.push(nextChildMountImage), ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild),
ReactReconciler_1.unmountComponent(prevChild, !1, !1)); ReactReconciler_1.unmountComponent(prevChild, !1, !1));
} }
} }
@ -2939,10 +2993,10 @@ var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComp
return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig,
Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig),
Constructor.prototype.constructor = Constructor, Constructor; Constructor.prototype.constructor = Constructor, Constructor;
}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; }, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack;
function takeSnapshot(view, options) { function takeSnapshot(view, options) {
return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"),
UIManager.__takeSnapshot(view, options); UIManager.__takeSnapshot(view, options);
} }
@ -3217,6 +3271,7 @@ ReactNativeInjection.inject(), ReactNativeStackInjection.inject();
var render = function(element, mountInto, callback) { var render = function(element, mountInto, callback) {
return ReactNativeMount_1.renderComponent(element, mountInto, callback); return ReactNativeMount_1.renderComponent(element, mountInto, callback);
}, ReactNative = { }, ReactNative = {
NativeComponent: ReactNativeComponent_1,
hasReactNativeInitialized: !1, hasReactNativeInitialized: !1,
findNodeHandle: findNumericNodeHandleStack, findNodeHandle: findNumericNodeHandleStack,
render: render, render: render,

View File

@ -1075,12 +1075,7 @@ var ReactReconciler = {
set: function(key, value) { set: function(key, value) {
key._reactInternalInstance = value; key._reactInternalInstance = value;
} }
}, ReactInstanceMap_1 = ReactInstanceMap, ReactFeatureFlags = { }, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = {
logTopLevelRenders: !1,
prepareNewChildrenBeforeUnmountInStack: !0,
disableNewFiberFeatures: !1,
enableAsyncSubtreeAPI: !1
}, ReactFeatureFlags_1 = ReactFeatureFlags, OBSERVED_ERROR = {}, TransactionImpl = {
reinitializeTransaction: function() { reinitializeTransaction: function() {
this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [],
this._isInTransaction = !1; this._isInTransaction = !1;
@ -1180,14 +1175,8 @@ function runBatchedUpdates(transaction) {
invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length),
dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; dirtyComponents.sort(mountOrderComparator), updateBatchNumber++;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
var markerName, component = dirtyComponents[i]; var component = dirtyComponents[i];
if (ReactFeatureFlags_1.logTopLevelRenders) { ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
var namedComponent = component;
component._currentElement.type.isReactTopLevelWrapper && (namedComponent = component._renderedComponent),
markerName = "React update: " + namedComponent.getName(), console.time(markerName);
}
ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber),
markerName && console.timeEnd(markerName);
} }
} }
@ -1482,15 +1471,12 @@ var nextMountID = 1, ReactCompositeComponent = {
_updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) {
var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement; var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement;
if (shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { if (shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else {
var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance); var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement);
ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack || ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1);
var nodeType = ReactNodeTypes_1.getType(nextRenderedElement);
this._renderedNodeType = nodeType; this._renderedNodeType = nodeType;
var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY);
this._renderedComponent = child; this._renderedComponent = child;
var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), 0); var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), 0);
ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
} }
}, },
_replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) { _replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) {
@ -1898,13 +1884,13 @@ var ReactNativeStackInspector = {
return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode();
}; };
function _classCallCheck$1(instance, Constructor) { function _classCallCheck$2(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
} }
var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() {
function ReactNativePropRegistry() { function ReactNativePropRegistry() {
_classCallCheck$1(this, ReactNativePropRegistry); _classCallCheck$2(this, ReactNativePropRegistry);
} }
return ReactNativePropRegistry.register = function(object) { return ReactNativePropRegistry.register = function(object) {
var id = ++uniqueID; var id = ++uniqueID;
@ -2023,7 +2009,7 @@ function mountSafeCallback$1(context, callback) {
}; };
} }
function throwOnStylesProp$1(component, props) { function throwOnStylesProp(component, props) {
if (void 0 !== props.styles) { if (void 0 !== props.styles) {
var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?";
throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."),
@ -2031,35 +2017,57 @@ function throwOnStylesProp$1(component, props) {
} }
} }
function warnForStyleProps$1(props, validAttributes) { function warnForStyleProps(props, validAttributes) {
for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`");
} }
var NativeMethodsMixinUtils = { var NativeMethodsMixinUtils = {
mountSafeCallback: mountSafeCallback$1, mountSafeCallback: mountSafeCallback$1,
throwOnStylesProp: throwOnStylesProp$1, throwOnStylesProp: throwOnStylesProp,
warnForStyleProps: warnForStyleProps$1 warnForStyleProps: warnForStyleProps
}, mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback));
},
measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback));
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess));
},
setNativeProps: function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
},
focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
},
blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}
}; };
function _classCallCheck$1(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _possibleConstructorReturn(self, call) {
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !call || "object" != typeof call && "function" != typeof call ? self : call;
}
function _inherits(subClass, superClass) {
if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: !1,
writable: !0,
configurable: !0
}
}), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass);
}
var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) {
_inherits(ReactNativeComponent, _React$Component);
function ReactNativeComponent() {
return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return ReactNativeComponent.prototype.blur = function() {
TextInputState.blurTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.focus = function() {
TextInputState.focusTextInput(findNumericNodeHandle(this));
}, ReactNativeComponent.prototype.measure = function(callback) {
UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback));
}, ReactNativeComponent.prototype.measureInWindow = function(callback) {
UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback));
}, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess));
}, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {
injectedSetNativeProps(this, nativeProps);
}, ReactNativeComponent;
}(React.Component);
function setNativePropsFiber(componentOrHandle, nativeProps) { function setNativePropsFiber(componentOrHandle, nativeProps) {
var maybeInstance = void 0; var maybeInstance = void 0;
try { try {
@ -2088,6 +2096,55 @@ var injectedSetNativeProps = void 0;
injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack;
var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = {
measure: function(callback) {
UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback));
},
measureInWindow: function(callback) {
UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback));
},
measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess));
},
setNativeProps: function(nativeProps) {
injectedSetNativeProps$1(this, nativeProps);
},
focus: function() {
TextInputState.focusTextInput(findNumericNodeHandle$1(this));
},
blur: function() {
TextInputState.blurTextInput(findNumericNodeHandle$1(this));
}
};
function setNativePropsFiber$1(componentOrHandle, nativeProps) {
var maybeInstance = void 0;
try {
maybeInstance = findNodeHandle_1(componentOrHandle);
} catch (error) {}
if (null != maybeInstance) {
var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload);
}
}
function setNativePropsStack$1(componentOrHandle, nativeProps) {
var maybeInstance = findNodeHandle_1(componentOrHandle);
if (null != maybeInstance) {
var viewConfig = void 0;
if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else {
for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent;
viewConfig = maybeInstance.viewConfig;
}
var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes);
UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload);
}
}
var injectedSetNativeProps$1 = void 0;
injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1;
var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = {
centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
@ -2204,12 +2261,10 @@ var ReactChildReconciler = {
var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name];
if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context),
nextChildren[name] = prevChild; else { nextChildren[name] = prevChild; else {
!ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild),
ReactReconciler_1.unmountComponent(prevChild, !1, !1));
var nextChildInstance = instantiateReactComponent_1(nextElement, !0); var nextChildInstance = instantiateReactComponent_1(nextElement, !0);
nextChildren[name] = nextChildInstance; nextChildren[name] = nextChildInstance;
var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
mountImages.push(nextChildMountImage), ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild),
ReactReconciler_1.unmountComponent(prevChild, !1, !1)); ReactReconciler_1.unmountComponent(prevChild, !1, !1));
} }
} }
@ -2430,10 +2485,10 @@ var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComp
return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig,
Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig),
Constructor.prototype.constructor = Constructor, Constructor; Constructor.prototype.constructor = Constructor, Constructor;
}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; }, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack;
function takeSnapshot(view, options) { function takeSnapshot(view, options) {
return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"),
UIManager.__takeSnapshot(view, options); UIManager.__takeSnapshot(view, options);
} }
@ -2444,6 +2499,7 @@ ReactNativeInjection.inject(), ReactNativeStackInjection.inject();
var render = function(element, mountInto, callback) { var render = function(element, mountInto, callback) {
return ReactNativeMount_1.renderComponent(element, mountInto, callback); return ReactNativeMount_1.renderComponent(element, mountInto, callback);
}, ReactNative = { }, ReactNative = {
NativeComponent: ReactNativeComponent_1,
hasReactNativeInitialized: !1, hasReactNativeInitialized: !1,
findNodeHandle: findNumericNodeHandleStack, findNodeHandle: findNumericNodeHandleStack,
render: render, render: render,

View File

@ -95,8 +95,10 @@ var addPoolingTo = function<T>(
CopyConstructor: Class<T>, CopyConstructor: Class<T>,
pooler: Pooler, pooler: Pooler,
): Class<T> & { ): Class<T> & {
getPooled(): /* arguments of the constructor */ T, getPooled(
release(): void, ...args: $ReadOnlyArray<mixed>
): /* arguments of the constructor */ T,
release(instance: mixed): void,
} { } {
// Casting as any so that flow ignores the actual implementation and trusts // Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared // it to match the type we declared

View File

@ -71,10 +71,11 @@ type SecretInternalsType = {
}; };
/** /**
* Flat ReactNative renderer bundles are too big for Flow to parse effeciently. * Flat ReactNative renderer bundles are too big for Flow to parse efficiently.
* Provide minimal Flow typing for the high-level RN API and call it a day. * Provide minimal Flow typing for the high-level RN API and call it a day.
*/ */
export type ReactNativeType = { export type ReactNativeType = {
NativeComponent: any,
findNodeHandle(componentOrHandle: any): ?number, findNodeHandle(componentOrHandle: any): ?number,
render( render(
element: React.Element<any>, element: React.Element<any>,