Build 541864stable
Module 587452
2,237 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(64700),a=n(267017),o=n(207147);e.exports=function(e){var t=function(t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);function n(){if(!(this instanceof n))throw TypeError("Cannot call a class as a function");var e=(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments);if(!this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&("object"==typeof e||"function"==typeof e)?e:this}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t),r(n,[{key:"componentWillUnmount",value:function(){this._propsAnimated&&this._propsAnimated.__detach()}},{key:"setNativeProps",value:function(e){!1===o.current(this.componentRef,e,this)&&this.forceUpdate()}},{key:"componentWillMount",value:function(){this.attachProps(this.props)}},{key:"attachProps",value:function(e){var t=this,n=this._propsAnimated;this._propsAnimated=new a(e,function(){!1===o.current(t.componentRef,t._propsAnimated.__getAnimatedValue(),t)&&t.forceUpdate()}),n&&n.__detach()}},{key:"componentWillReceiveProps",value:function(e){this.attachProps(e)}},{key:"render",value:function(){var t=this,n=this._propsAnimated.__getValue(),r=n.style,a=function(e,t){var n={};for(var i in e)!(t.indexOf(i)>=0)&&Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(n,["style"]);return s.createElement(e,i({},a,{style:o.transformStyles(r),ref:function(e){t.componentRef=e},__source:{fileName:"src/createAnimatedComponent.js",lineNumber:75}}))}},{key:"getNode",value:function(){return this.componentRef}}]),n}(s.Component);return t.propTypes={style:function(t,n,i){if(!e.propTypes)return}},t}}