react-window-decorators
Advanced tools
Comparing version 1.0.6 to 1.0.7
# Changelog | ||
### v1.0.7 | ||
28.09.2020. | ||
**Fixed** | ||
* Moved event bindings to `componentDidMount` to fix `Can't call setState on a component that is not yet mounted` error. It might help with [Plx issue #60](https://github.com/Stanko/react-plx/issues/60) as well. | ||
----- | ||
### v1.0.6 | ||
@@ -4,0 +14,0 @@ |
@@ -47,5 +47,3 @@ 'use strict'; | ||
// Bind events | ||
_this.handleScrollChange = _this.handleScrollChange.bind(_this); | ||
window.addEventListener('window-scroll', _this.handleScrollChange); | ||
} | ||
@@ -63,2 +61,8 @@ | ||
_createClass(ScrollDecorator, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
// Bind events | ||
window.addEventListener('window-scroll', this.handleScrollChange); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
@@ -65,0 +69,0 @@ value: function componentWillUnmount() { |
@@ -55,6 +55,2 @@ 'use strict'; | ||
state.isTouchDevice = _this.windowManager.isTouchDevice(); | ||
// Bind events | ||
_this.handleWindowResize = _this.handleWindowResize.bind(_this); | ||
window.addEventListener('window-resize', _this.handleWindowResize); | ||
} | ||
@@ -67,2 +63,9 @@ | ||
_createClass(WindowDecorator, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
// Bind events | ||
this.handleWindowResize = this.handleWindowResize.bind(this); | ||
window.addEventListener('window-resize', this.handleWindowResize); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
@@ -69,0 +72,0 @@ value: function componentWillUnmount() { |
{ | ||
"name": "react-window-decorators", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -19,5 +19,3 @@ import React, { Component } from 'react'; | ||
// Bind events | ||
this.handleScrollChange = this.handleScrollChange.bind(this); | ||
window.addEventListener('window-scroll', this.handleScrollChange); | ||
} | ||
@@ -33,2 +31,7 @@ | ||
componentDidMount() { | ||
// Bind events | ||
window.addEventListener('window-scroll', this.handleScrollChange); | ||
} | ||
componentWillUnmount() { | ||
@@ -35,0 +38,0 @@ // Remove and reset interval/animationFrame |
@@ -27,6 +27,2 @@ import React, { Component } from 'react'; | ||
state.isTouchDevice = this.windowManager.isTouchDevice(); | ||
// Bind events | ||
this.handleWindowResize = this.handleWindowResize.bind(this); | ||
window.addEventListener('window-resize', this.handleWindowResize); | ||
} | ||
@@ -37,2 +33,8 @@ | ||
componentDidMount() { | ||
// Bind events | ||
this.handleWindowResize = this.handleWindowResize.bind(this); | ||
window.addEventListener('window-resize', this.handleWindowResize); | ||
} | ||
componentWillUnmount() { | ||
@@ -39,0 +41,0 @@ // Remove and reset interval/animationFrame |
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
38547
17
779