From f9d7ffa9b653a1c245c028038325dfe18a24d704 Mon Sep 17 00:00:00 2001 From: wwayne Date: Fri, 19 Aug 2016 07:35:05 +0530 Subject: [PATCH] Judge if the component has been mounted mount in getContent #180 --- src/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 7b7d968ba..779527a0e 100644 --- a/src/index.js +++ b/src/index.js @@ -249,11 +249,13 @@ class ReactTooltip extends Component { if (getContent && Array.isArray(getContent)) { this.intervalUpdateContent = setInterval(() => { - const {getContent} = this.props - const placeholder = getTipContent(originTooltip, getContent[0](), isMultiline) - this.setState({ - placeholder - }) + if (this.mount) { + const {getContent} = this.props + const placeholder = getTipContent(originTooltip, getContent[0](), isMultiline) + this.setState({ + placeholder + }) + } }, getContent[1]) } })