(current,element,callback)
| 7944 | * @providesModule getContextForSubtree |
| 7945 | * |
| 7946 | */var getContextFiber=function getContextFiber(arg){invariant(false,'Missing injection for fiber getContextForSubtree');};function getContextForSubtree(parentComponent){if(!parentComponent){return emptyObject;}var instance=ReactInstanceMap_1.get(parentComponent);if(typeof instance.tag==='number'){return getContextFiber(instance);}else{return instance._processChildContext(instance._context);}}getContextForSubtree._injectFiber=function(fn){getContextFiber=fn;};var getContextForSubtree_1=getContextForSubtree;var addTopLevelUpdate=ReactFiberUpdateQueue.addTopLevelUpdate;var findCurrentUnmaskedContext=ReactFiberContext.findCurrentUnmaskedContext;var isContextProvider=ReactFiberContext.isContextProvider;var processChildContext=ReactFiberContext.processChildContext;var createFiberRoot=ReactFiberRoot.createFiberRoot;var HostComponent$3=ReactTypeOfWork.HostComponent;{var warning$18=require$$0;var ReactFiberInstrumentation=ReactFiberInstrumentation_1;var ReactDebugCurrentFiber$1=ReactDebugCurrentFiber_1;var getComponentName$4=getComponentName_1;}var findCurrentHostFiber$1=ReactFiberTreeReflection.findCurrentHostFiber;var findCurrentHostFiberWithNoPortals$1=ReactFiberTreeReflection.findCurrentHostFiberWithNoPortals;getContextForSubtree_1._injectFiber(function(fiber){var parentContext=findCurrentUnmaskedContext(fiber);return isContextProvider(fiber)?processChildContext(fiber,parentContext,false):parentContext;});var ReactFiberReconciler=function ReactFiberReconciler(config){var getPublicInstance=config.getPublicInstance;var _ReactFiberScheduler=ReactFiberScheduler(config),scheduleUpdate=_ReactFiberScheduler.scheduleUpdate,getPriorityContext=_ReactFiberScheduler.getPriorityContext,batchedUpdates=_ReactFiberScheduler.batchedUpdates,unbatchedUpdates=_ReactFiberScheduler.unbatchedUpdates,flushSync=_ReactFiberScheduler.flushSync,deferredUpdates=_ReactFiberScheduler.deferredUpdates;function scheduleTopLevelUpdate(current,element,callback){{if(ReactDebugCurrentFiber$1.phase==='render'&&ReactDebugCurrentFiber$1.current!==null){warning$18(false,'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$4(ReactDebugCurrentFiber$1.current)||'Unknown');}}// Check if the top-level element is an async wrapper component. If so, treat |
| 7947 | // updates to the root as async. This is a bit weird but lets us avoid a separate |
| 7948 | // `renderAsync` API. |
| 7949 | var forceAsync=ReactFeatureFlags_1.enableAsyncSubtreeAPI&&element!=null&&element.type!=null&&element.type.prototype!=null&&element.type.prototype.unstable_isAsyncReactComponent===true;var priorityLevel=getPriorityContext(current,forceAsync);var nextState={element:element};callback=callback===undefined?null:callback;{warning$18(callback===null||typeof callback==='function','render(...): Expected the last optional `callback` argument to be a '+'function. Instead received: %s.',callback);}addTopLevelUpdate(current,nextState,callback,priorityLevel);scheduleUpdate(current,priorityLevel);}return{createContainer:function createContainer(containerInfo){return createFiberRoot(containerInfo);},updateContainer:function updateContainer(element,container,parentComponent,callback){// TODO: If this is a nested container, this won't be the root. |
| 7950 | var current=container.current;{if(ReactFiberInstrumentation.debugTool){if(current.alternate===null){ReactFiberInstrumentation.debugTool.onMountContainer(container);}else if(element===null){ReactFiberInstrumentation.debugTool.onUnmountContainer(container);}else{ReactFiberInstrumentation.debugTool.onUpdateContainer(container);}}}var context=getContextForSubtree_1(parentComponent);if(container.context===null){container.context=context;}else{container.pendingContext=context;}scheduleTopLevelUpdate(current,element,callback);},batchedUpdates:batchedUpdates,unbatchedUpdates:unbatchedUpdates,deferredUpdates:deferredUpdates,flushSync:flushSync,getPublicRootInstance:function getPublicRootInstance(container){var containerFiber=container.current;if(!containerFiber.child){return null;}switch(containerFiber.child.tag){case HostComponent$3:return getPublicInstance(containerFiber.child.stateNode);default:return containerFiber.child.stateNode;}},findHostInstance:function findHostInstance(fiber){var hostFiber=findCurrentHostFiber$1(fiber);if(hostFiber===null){return null;}return hostFiber.stateNode;},findHostInstanceWithNoPortals:function findHostInstanceWithNoPortals(fiber){var hostFiber=findCurrentHostFiberWithNoPortals$1(fiber);if(hostFiber===null){return null;}return hostFiber.stateNode;}};};var TEXT_NODE$3=HTMLNodeType_1.TEXT_NODE;/** |
| 7951 | * Given any node return the first leaf node without children. |
| 7952 | * |
no test coverage detected