chayns-api 3.6.1 → 3.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -115,7 +115,12 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
115
115
  OriginalCompatComponent.componentDidUpdate.apply(this, prevProps, prevState, snapshot);
116
116
  }
117
117
  componentWillUnmount() {
118
- OriginalCompatComponent.componentWillUnmount.apply(this);
118
+ clearTimeout(this.timeout);
119
+ if (typeof OriginalCompatComponent.componentWillUnmount === 'function') {
120
+ OriginalCompatComponent.componentWillUnmount.apply(this);
121
+ } else if (this.root) {
122
+ this.root.unmount();
123
+ }
119
124
  }
120
125
  render() {
121
126
  return _react.default.createElement('div', {
@@ -102,6 +102,8 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
102
102
  constructor(props) {
103
103
  super(props);
104
104
  _defineProperty(this, "ref", void 0);
105
+ _defineProperty(this, "timeout", void 0);
106
+ _defineProperty(this, "root", void 0);
105
107
  this.ref = React.createRef();
106
108
  }
107
109
  componentDidMount() {
@@ -111,7 +113,12 @@ const loadComponent = (scope, module, url, skipCompatMode = false, preventSingle
111
113
  OriginalCompatComponent.componentDidUpdate.apply(this, prevProps, prevState, snapshot);
112
114
  }
113
115
  componentWillUnmount() {
114
- OriginalCompatComponent.componentWillUnmount.apply(this);
116
+ clearTimeout(this.timeout);
117
+ if (typeof OriginalCompatComponent.componentWillUnmount === 'function') {
118
+ OriginalCompatComponent.componentWillUnmount.apply(this);
119
+ } else if (this.root) {
120
+ this.root.unmount();
121
+ }
115
122
  }
116
123
  render() {
117
124
  return React.createElement('div', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chayns-api",
3
- "version": "3.6.1",
3
+ "version": "3.6.2",
4
4
  "description": "new chayns api",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",