MCPcopy Create free account
hub / github.com/microsoft/SandDance / FiberNode

Function FiberNode

docs/external/js/react-dom.development.js:23711–23782  ·  view source on GitHub ↗
(tag, pendingProps, key, mode)

Source from the content-addressed store, hash-verified

23709 var debugCounter = 1;
23710
23711 function FiberNode(tag, pendingProps, key, mode) {
23712 // Instance
23713 this.tag = tag;
23714 this.key = key;
23715 this.elementType = null;
23716 this.type = null;
23717 this.stateNode = null; // Fiber
23718
23719 this.return = null;
23720 this.child = null;
23721 this.sibling = null;
23722 this.index = 0;
23723 this.ref = null;
23724 this.pendingProps = pendingProps;
23725 this.memoizedProps = null;
23726 this.updateQueue = null;
23727 this.memoizedState = null;
23728 this.dependencies = null;
23729 this.mode = mode; // Effects
23730
23731 this.effectTag = NoEffect;
23732 this.nextEffect = null;
23733 this.firstEffect = null;
23734 this.lastEffect = null;
23735 this.expirationTime = NoWork;
23736 this.childExpirationTime = NoWork;
23737 this.alternate = null;
23738
23739 {
23740 // Note: The following is done to avoid a v8 performance cliff.
23741 //
23742 // Initializing the fields below to smis and later updating them with
23743 // double values will cause Fibers to end up having separate shapes.
23744 // This behavior/bug has something to do with Object.preventExtension().
23745 // Fortunately this only impacts DEV builds.
23746 // Unfortunately it makes React unusably slow for some applications.
23747 // To work around this, initialize the fields below with doubles.
23748 //
23749 // Learn more about this here:
23750 // https://github.com/facebook/react/issues/14365
23751 // https://bugs.chromium.org/p/v8/issues/detail?id=8538
23752 this.actualDuration = Number.NaN;
23753 this.actualStartTime = Number.NaN;
23754 this.selfBaseDuration = Number.NaN;
23755 this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
23756 // This won't trigger the performance cliff mentioned above,
23757 // and it simplifies other profiler code (including DevTools).
23758
23759 this.actualDuration = 0;
23760 this.actualStartTime = -1;
23761 this.selfBaseDuration = 0;
23762 this.treeBaseDuration = 0;
23763 } // This is normally DEV-only except www when it adds listeners.
23764 // TODO: remove the User Timing integration in favor of Root Events.
23765
23766
23767 {
23768 this._debugID = debugCounter++;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected