MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / mountClassInstance

Function mountClassInstance

bundle.js:7239–7241  ·  view source on GitHub ↗
(workInProgress,priorityLevel)

Source from the content-addressed store, hash-verified

7237// ReactFiberContext usually updates this cache but can't for newly-created instances.
7238if(needsContext){cacheContext$1(workInProgress,unmaskedContext,context);}return instance;}function callComponentWillMount(workInProgress,instance){{startPhaseTimer$1(workInProgress,'componentWillMount');}var oldState=instance.state;instance.componentWillMount();{stopPhaseTimer$1();}if(oldState!==instance.state){{warning$25(false,'%s.componentWillMount(): Assigning directly to this.state is '+"deprecated (except inside a component's "+'constructor). Use setState instead.',getComponentName_1(workInProgress));}updater.enqueueReplaceState(instance,instance.state,null);}}function callComponentWillReceiveProps(workInProgress,instance,newProps,newContext){{startPhaseTimer$1(workInProgress,'componentWillReceiveProps');}var oldState=instance.state;instance.componentWillReceiveProps(newProps,newContext);{stopPhaseTimer$1();}if(instance.state!==oldState){{warning$25(false,'%s.componentWillReceiveProps(): Assigning directly to '+"this.state is deprecated (except inside a component's "+'constructor). Use setState instead.',getComponentName_1(workInProgress));}updater.enqueueReplaceState(instance,instance.state,null);}}// Invokes the mount life-cycles on a previously never rendered instance.
7239function mountClassInstance(workInProgress,priorityLevel){var current=workInProgress.alternate;{checkClassInstance(workInProgress);}var instance=workInProgress.stateNode;var state=instance.state||null;var props=workInProgress.pendingProps;!props?invariant(false,'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.'):void 0;var unmaskedContext=getUnmaskedContext$2(workInProgress);instance.props=props;instance.state=state;instance.refs=emptyObject;instance.context=getMaskedContext$2(workInProgress,unmaskedContext);if(ReactFeatureFlags_1.enableAsyncSubtreeAPI&&workInProgress.type!=null&&workInProgress.type.prototype!=null&&workInProgress.type.prototype.unstable_isAsyncReactComponent===true){workInProgress.internalContextTag|=AsyncUpdates$1;}if(typeof instance.componentWillMount==='function'){callComponentWillMount(workInProgress,instance);// If we had additional state updates during this life-cycle, let's
7240// process them now.
7241var updateQueue=workInProgress.updateQueue;if(updateQueue!==null){instance.state=beginUpdateQueue$2(current,workInProgress,updateQueue,instance,state,props,priorityLevel);}}if(typeof instance.componentDidMount==='function'){workInProgress.effectTag|=Update$1;}}// Called on a preexisting class instance. Returns false if a resumed render
7242// could be reused.
7243// function resumeMountClassInstance(
7244// workInProgress: Fiber,

Callers 2

updateClassComponentFunction · 0.85

Calls 3

checkClassInstanceFunction · 0.85
callComponentWillMountFunction · 0.85
invariantFunction · 0.70

Tested by

no test coverage detected