react-tag-cloud
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -133,2 +133,16 @@ module.exports = | ||
_createClass(TagCloud, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
this._mounted = true; | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this._resizeTimer) { | ||
clearTimeout(this._resizeTimer); | ||
this._resizeTimer = undefined; | ||
} | ||
this._mounted = false; | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -150,2 +164,3 @@ value: function componentWillReceiveProps(nextProps) { | ||
this.calculateLayout(props).then(function (children) { | ||
if (!_this2._mounted) return; | ||
_this2.setState({ | ||
@@ -152,0 +167,0 @@ wrappedChildren: children |
{ | ||
"name": "react-tag-cloud", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Create beautiful tag/word clouds using React", | ||
@@ -20,3 +20,4 @@ "keywords": [ | ||
"files": [ | ||
"src" | ||
"src", | ||
"dist" | ||
], | ||
@@ -23,0 +24,0 @@ "scripts": { |
@@ -29,4 +29,4 @@ # react-tag-cloud ☁️ | ||
fontSize: 30, | ||
fontWeight: 'bold' | ||
fontStyle: 'italic' | ||
fontWeight: 'bold', | ||
fontStyle: 'italic', | ||
color: () => randomColor(), | ||
@@ -33,0 +33,0 @@ padding: 5, |
@@ -76,2 +76,14 @@ import React, { Component } from 'react'; | ||
componentDidMount() { | ||
this._mounted = true; | ||
} | ||
componentWillUnmount() { | ||
if (this._resizeTimer) { | ||
clearTimeout(this._resizeTimer); | ||
this._resizeTimer = undefined; | ||
} | ||
this._mounted = false; | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
@@ -89,2 +101,3 @@ this.updateLayout(nextProps, true); | ||
this.calculateLayout(props).then((children) => { | ||
if (!this._mounted) return; | ||
this.setState({ | ||
@@ -91,0 +104,0 @@ wrappedChildren: children |
22914
527