diff --git a/lib/components/FlipCard.js b/lib/components/FlipCard.js index f3979ee..7d78c6c 100644 --- a/lib/components/FlipCard.js +++ b/lib/components/FlipCard.js @@ -54,7 +54,7 @@ export default React.createClass({ this._showBothSides(); // Wait for display above to take effect - setTimeout(() => { + this._flipTimeout = setTimeout(() => { this.setState({ isFlipped: newProps.flipped }); @@ -100,7 +100,12 @@ export default React.createClass({ } // Hide whichever side of the card is down - setTimeout(this._hideFlippedSide, 600); + this._hideSideTimeout = setTimeout(this._hideFlippedSide, 600); + }, + + componentWillUnmount() { + clearTimeout(this._hideSideTimeout); + clearTimeout(this._flipTimeout); }, handleFocus() {