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

Function resetInputPointers

bundle.js:7235–7235  ·  view source on GitHub ↗
(workInProgress,instance)

Source from the content-addressed store, hash-verified

7233Object.defineProperty(fakeInternalInstance,'_processChildContext',{enumerable:false,value:function value(){invariant(false,'_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).');}});Object.freeze(fakeInternalInstance);}var ReactFiberClassComponent=function ReactFiberClassComponent(scheduleUpdate,getPriorityContext,memoizeProps,memoizeState){// Class component state updater
7234var updater={isMounted:isMounted$1,enqueueSetState:function enqueueSetState(instance,partialState,callback){var fiber=ReactInstanceMap_1.get(instance);var priorityLevel=getPriorityContext(fiber,false);callback=callback===undefined?null:callback;{warnOnInvalidCallback(callback,'setState');}addUpdate$1(fiber,partialState,callback,priorityLevel);scheduleUpdate(fiber,priorityLevel);},enqueueReplaceState:function enqueueReplaceState(instance,state,callback){var fiber=ReactInstanceMap_1.get(instance);var priorityLevel=getPriorityContext(fiber,false);callback=callback===undefined?null:callback;{warnOnInvalidCallback(callback,'replaceState');}addReplaceUpdate$1(fiber,state,callback,priorityLevel);scheduleUpdate(fiber,priorityLevel);},enqueueForceUpdate:function enqueueForceUpdate(instance,callback){var fiber=ReactInstanceMap_1.get(instance);var priorityLevel=getPriorityContext(fiber,false);callback=callback===undefined?null:callback;{warnOnInvalidCallback(callback,'forceUpdate');}addForceUpdate$1(fiber,callback,priorityLevel);scheduleUpdate(fiber,priorityLevel);}};function checkShouldComponentUpdate(workInProgress,oldProps,newProps,oldState,newState,newContext){if(oldProps===null||workInProgress.updateQueue!==null&&workInProgress.updateQueue.hasForceUpdate){// If the workInProgress already has an Update effect, return true
7235return true;}var instance=workInProgress.stateNode;var type=workInProgress.type;if(typeof instance.shouldComponentUpdate==='function'){{startPhaseTimer$1(workInProgress,'shouldComponentUpdate');}var shouldUpdate=instance.shouldComponentUpdate(newProps,newState,newContext);{stopPhaseTimer$1();}{warning$25(shouldUpdate!==undefined,'%s.shouldComponentUpdate(): Returned undefined instead of a '+'boolean value. Make sure to return true or false.',getComponentName_1(workInProgress)||'Unknown');}return shouldUpdate;}if(type.prototype&&type.prototype.isPureReactComponent){return!shallowEqual(oldProps,newProps)||!shallowEqual(oldState,newState);}return true;}function checkClassInstance(workInProgress){var instance=workInProgress.stateNode;var type=workInProgress.type;{var name=getComponentName_1(workInProgress);var renderPresent=instance.render;warning$25(renderPresent,'%s(...): No `render` method found on the returned component '+'instance: you may have forgotten to define `render`.',name);var noGetInitialStateOnES6=!instance.getInitialState||instance.getInitialState.isReactClassApproved||instance.state;warning$25(noGetInitialStateOnES6,'getInitialState was defined on %s, a plain JavaScript class. '+'This is only supported for classes created using React.createClass. '+'Did you mean to define a state property instead?',name);var noGetDefaultPropsOnES6=!instance.getDefaultProps||instance.getDefaultProps.isReactClassApproved;warning$25(noGetDefaultPropsOnES6,'getDefaultProps was defined on %s, a plain JavaScript class. '+'This is only supported for classes created using React.createClass. '+'Use a static property to define defaultProps instead.',name);var noInstancePropTypes=!instance.propTypes;warning$25(noInstancePropTypes,'propTypes was defined as an instance property on %s. Use a static '+'property to define propTypes instead.',name);var noInstanceContextTypes=!instance.contextTypes;warning$25(noInstanceContextTypes,'contextTypes was defined as an instance property on %s. Use a static '+'property to define contextTypes instead.',name);var noComponentShouldUpdate=typeof instance.componentShouldUpdate!=='function';warning$25(noComponentShouldUpdate,'%s has a method called '+'componentShouldUpdate(). Did you mean shouldComponentUpdate()? '+'The name is phrased as a question because the function is '+'expected to return a value.',name);if(type.prototype&&type.prototype.isPureReactComponent&&typeof instance.shouldComponentUpdate!=='undefined'){warning$25(false,'%s has a method called shouldComponentUpdate(). '+'shouldComponentUpdate should not be used when extending React.PureComponent. '+'Please extend React.Component if shouldComponentUpdate is used.',getComponentName_1(workInProgress)||'A pure component');}var noComponentDidUnmount=typeof instance.componentDidUnmount!=='function';warning$25(noComponentDidUnmount,'%s has a method called '+'componentDidUnmount(). But there is no such lifecycle method. '+'Did you mean componentWillUnmount()?',name);var noComponentWillRecieveProps=typeof instance.componentWillRecieveProps!=='function';warning$25(noComponentWillRecieveProps,'%s has a method called '+'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',name);var hasMutatedProps=instance.props!==workInProgress.pendingProps;warning$25(instance.props===undefined||!hasMutatedProps,'%s(...): When calling super() in `%s`, make sure to pass '+"up the same props that your component's constructor was passed.",name,name);var noInstanceDefaultProps=!instance.defaultProps;warning$25(noInstanceDefaultProps,'Setting defaultProps as an instance property on %s is not supported and will be ignored.'+' Instead, define defaultProps as a static property on %s.',name,name);}var state=instance.state;if(state&&((typeof state==='undefined'?'undefined':_typeof(state))!=='object'||isArray$1(state))){invariant(false,'%s.state: must be set to an object or null',getComponentName_1(workInProgress));}if(typeof instance.getChildContext==='function'){!(_typeof(workInProgress.type.childContextTypes)==='object')?invariant(false,'%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().',getComponentName_1(workInProgress)):void 0;}}function resetInputPointers(workInProgress,instance){instance.props=workInProgress.memoizedProps;instance.state=workInProgress.memoizedState;}function adoptClassInstance(workInProgress,instance){instance.updater=updater;workInProgress.stateNode=instance;// The instance needs access to the fiber so that it can schedule updates
7236ReactInstanceMap_1.set(instance,workInProgress);{instance._reactInternalInstance=fakeInternalInstance;}}function constructClassInstance(workInProgress,props){var ctor=workInProgress.type;var unmaskedContext=getUnmaskedContext$2(workInProgress);var needsContext=isContextConsumer$1(workInProgress);var context=needsContext?getMaskedContext$2(workInProgress,unmaskedContext):emptyObject;var instance=new ctor(props,context);adoptClassInstance(workInProgress,instance);// Cache unmasked context so we can avoid recreating masked context unless necessary.
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.

Callers 1

updateClassInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected