Skip to content

Commit 5131030

Browse files
authored
Merge pull request #181 from wwayne/get-content
Judge if the component has been mounted mount in getContent #180
2 parents 045e39a + f9d7ffa commit 5131030

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,13 @@ class ReactTooltip extends Component {
249249

250250
if (getContent && Array.isArray(getContent)) {
251251
this.intervalUpdateContent = setInterval(() => {
252-
const {getContent} = this.props
253-
const placeholder = getTipContent(originTooltip, getContent[0](), isMultiline)
254-
this.setState({
255-
placeholder
256-
})
252+
if (this.mount) {
253+
const {getContent} = this.props
254+
const placeholder = getTipContent(originTooltip, getContent[0](), isMultiline)
255+
this.setState({
256+
placeholder
257+
})
258+
}
257259
}, getContent[1])
258260
}
259261
})

0 commit comments

Comments
 (0)