react-lifecycles-compat
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "react-lifecycles-compat", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Backwards compatibility polyfill for React class components", | ||
@@ -5,0 +5,0 @@ "main": "react-lifecycles-compat.cjs.js", |
@@ -68,5 +68,5 @@ 'use strict'; | ||
// Because they would work differently between older and newer (16.3+) versions of React. | ||
let foundWillMountName = null; | ||
let foundWillReceivePropsName = null; | ||
let foundWillUpdateName = null; | ||
var foundWillMountName = null; | ||
var foundWillReceivePropsName = null; | ||
var foundWillUpdateName = null; | ||
if (typeof prototype.componentWillMount === 'function') { | ||
@@ -73,0 +73,0 @@ foundWillMountName = 'componentWillMount'; |
@@ -64,5 +64,5 @@ /** | ||
// Because they would work differently between older and newer (16.3+) versions of React. | ||
let foundWillMountName = null; | ||
let foundWillReceivePropsName = null; | ||
let foundWillUpdateName = null; | ||
var foundWillMountName = null; | ||
var foundWillReceivePropsName = null; | ||
var foundWillUpdateName = null; | ||
if (typeof prototype.componentWillMount === 'function') { | ||
@@ -69,0 +69,0 @@ foundWillMountName = 'componentWillMount'; |
@@ -70,5 +70,5 @@ (function (global, factory) { | ||
// Because they would work differently between older and newer (16.3+) versions of React. | ||
let foundWillMountName = null; | ||
let foundWillReceivePropsName = null; | ||
let foundWillUpdateName = null; | ||
var foundWillMountName = null; | ||
var foundWillReceivePropsName = null; | ||
var foundWillUpdateName = null; | ||
if (typeof prototype.componentWillMount === 'function') { | ||
@@ -75,0 +75,0 @@ foundWillMountName = 'componentWillMount'; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.reactLifecyclesCompat={})}(this,function(e){"use strict";function t(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){var t=this.constructor.getDerivedStateFromProps(e,this.state);null!==t&&void 0!==t&&this.setState(t)}function n(e,t){try{var o=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(o,n)}finally{this.props=o,this.state=n}}t.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,n.__suppressDeprecationWarning=!0,e.polyfill=function(e){var i=e.prototype;if(!i||!i.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof i.getSnapshotBeforeUpdate)return e;let p=null,l=null,r=null;if("function"==typeof i.componentWillMount?p="componentWillMount":"function"==typeof i.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof i.componentWillReceiveProps?l="componentWillReceiveProps":"function"==typeof i.UNSAFE_componentWillReceiveProps&&(l="UNSAFE_componentWillReceiveProps"),"function"==typeof i.componentWillUpdate?r="componentWillUpdate":"function"==typeof i.UNSAFE_componentWillUpdate&&(r="UNSAFE_componentWillUpdate"),null!==p||null!==l||null!==r){var s=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+`${s} uses ${a} but also contains the following legacy lifecycles:`+(null!==p?`\n ${p}`:"")+(null!==l?`\n ${l}`:"")+(null!==r?`\n ${r}`:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(i.componentWillMount=t,i.componentWillReceiveProps=o),"function"==typeof i.getSnapshotBeforeUpdate){if("function"!=typeof i.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");i.componentWillUpdate=n;var c=i.componentDidUpdate;i.componentDidUpdate=function(e,t,o){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:o;c.call(this,e,t,n)}}return e},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.reactLifecyclesCompat={})}(this,function(e){"use strict";function t(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function o(e){var t=this.constructor.getDerivedStateFromProps(e,this.state);null!==t&&void 0!==t&&this.setState(t)}function n(e,t){try{var o=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(o,n)}finally{this.props=o,this.state=n}}t.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,n.__suppressDeprecationWarning=!0,e.polyfill=function(e){var i=e.prototype;if(!i||!i.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof i.getSnapshotBeforeUpdate)return e;var p=null,l=null,r=null;if("function"==typeof i.componentWillMount?p="componentWillMount":"function"==typeof i.UNSAFE_componentWillMount&&(p="UNSAFE_componentWillMount"),"function"==typeof i.componentWillReceiveProps?l="componentWillReceiveProps":"function"==typeof i.UNSAFE_componentWillReceiveProps&&(l="UNSAFE_componentWillReceiveProps"),"function"==typeof i.componentWillUpdate?r="componentWillUpdate":"function"==typeof i.UNSAFE_componentWillUpdate&&(r="UNSAFE_componentWillUpdate"),null!==p||null!==l||null!==r){var s=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+`${s} uses ${a} but also contains the following legacy lifecycles:`+(null!==p?`\n ${p}`:"")+(null!==l?`\n ${l}`:"")+(null!==r?`\n ${r}`:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(i.componentWillMount=t,i.componentWillReceiveProps=o),"function"==typeof i.getSnapshotBeforeUpdate){if("function"!=typeof i.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");i.componentWillUpdate=n;var c=i.componentDidUpdate;i.componentDidUpdate=function(e,t,o){var n=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:o;c.call(this,e,t,n)}}return e},Object.defineProperty(e,"__esModule",{value:!0})}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27176
8