Socket
Socket
Sign inDemoInstall

react-lifecycles-compat

Package Overview
Dependencies
Maintainers
7
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lifecycles-compat - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

2

package.json
{
"name": "react-lifecycles-compat",
"version": "1.1.2",
"version": "1.1.3",
"description": "Backwards compatibility polyfill for React class components",

@@ -5,0 +5,0 @@ "main": "react-lifecycles-compat.cjs.js",

@@ -91,10 +91,12 @@ 'use strict';

prevProps,
prevState
prevState,
maybeSnapshot
) {
componentDidUpdate.call(
this,
prevProps,
prevState,
this.__reactInternalSnapshot
);
// 16.3+ will pass a snapshot value.
// Older versions will rely on our polyfilled value.
// It's important to check for the "__reactInternalSnapshot" value first though,
// Since <= 15.x versions of React will pass a prevContext param to componentDidUpdate.
var snapshot = this.__reactInternalSnapshot || maybeSnapshot;
componentDidUpdate.call(this, prevProps, prevState, snapshot);
};

@@ -101,0 +103,0 @@ }

@@ -95,10 +95,12 @@ (function (global, factory) {

prevProps,
prevState
prevState,
maybeSnapshot
) {
componentDidUpdate.call(
this,
prevProps,
prevState,
this.__reactInternalSnapshot
);
// 16.3+ will pass a snapshot value.
// Older versions will rely on our polyfilled value.
// It's important to check for the "__reactInternalSnapshot" value first though,
// Since <= 15.x versions of React will pass a prevContext param to componentDidUpdate.
var snapshot = this.__reactInternalSnapshot || maybeSnapshot;
componentDidUpdate.call(this, prevProps, prevState, snapshot);
};

@@ -105,0 +107,0 @@ }

@@ -1,1 +0,1 @@

!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):t.reactLifecyclesCompat=o()}(this,function(){"use strict";function t(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==t&&void 0!==t&&this.setState(t)}function o(t){var o=this.constructor.getDerivedStateFromProps(t,this.state);null!==o&&void 0!==o&&this.setState(o)}function e(t,o){try{var e=this.props,n=this.state;this.props=t,this.state=o,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(e,n)}finally{this.props=e,this.state=n}}return t.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,e.__suppressDeprecationWarning=!0,function(n){if(!n.prototype||!n.prototype.isReactComponent)throw new Error("Can only polyfill class components");if("function"==typeof n.getDerivedStateFromProps){if("function"==typeof n.prototype.componentWillMount)throw new Error("Cannot polyfill getDerivedStateFromProps() for components that define componentWillMount()");if("function"==typeof n.prototype.componentWillReceiveProps)throw new Error("Cannot polyfill getDerivedStateFromProps() for components that define componentWillReceiveProps()");n.prototype.componentWillMount=t,n.prototype.componentWillReceiveProps=o}if("function"==typeof n.prototype.getSnapshotBeforeUpdate){if("function"==typeof n.prototype.componentWillUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that define componentWillUpdate()");if("function"!=typeof n.prototype.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");n.prototype.componentWillUpdate=e;var p=n.prototype.componentDidUpdate;n.prototype.componentDidUpdate=function(t,o){p.call(this,t,o,this.__reactInternalSnapshot)}}return n}});
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):t.reactLifecyclesCompat=o()}(this,function(){"use strict";function t(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==t&&void 0!==t&&this.setState(t)}function o(t){var o=this.constructor.getDerivedStateFromProps(t,this.state);null!==o&&void 0!==o&&this.setState(o)}function e(t,o){try{var e=this.props,n=this.state;this.props=t,this.state=o,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(e,n)}finally{this.props=e,this.state=n}}return t.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,e.__suppressDeprecationWarning=!0,function(n){if(!n.prototype||!n.prototype.isReactComponent)throw new Error("Can only polyfill class components");if("function"==typeof n.getDerivedStateFromProps){if("function"==typeof n.prototype.componentWillMount)throw new Error("Cannot polyfill getDerivedStateFromProps() for components that define componentWillMount()");if("function"==typeof n.prototype.componentWillReceiveProps)throw new Error("Cannot polyfill getDerivedStateFromProps() for components that define componentWillReceiveProps()");n.prototype.componentWillMount=t,n.prototype.componentWillReceiveProps=o}if("function"==typeof n.prototype.getSnapshotBeforeUpdate){if("function"==typeof n.prototype.componentWillUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that define componentWillUpdate()");if("function"!=typeof n.prototype.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");n.prototype.componentWillUpdate=e;var p=n.prototype.componentDidUpdate;n.prototype.componentDidUpdate=function(t,o,e){var n=this.__reactInternalSnapshot||e;p.call(this,t,o,n)}}return n}});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc