Skip to content

Latest commit

History

History
36 lines (29 loc) · 903 Bytes

File metadata and controls

36 lines (29 loc) · 903 Bytes
constemptyObject={};if(__DEV__){Object.freeze(emptyObject);}functionComponent(props,context,updater){this.props=props;this.context=context;this.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue;}Component.prototype.isReactComponent={};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,'forceUpdate')}functionComponentDummy(){}ComponentDummy.prototype=Component.prototype;functionPureComponent(props,context,updater){this.props=props;this.context=context;this.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue;}constpureComponentPrototype=();pureComponentPrototype.constructor=PureComponent;Object.assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=true;export{Component,PureComponent};