import React, {PropTypes} from 'react';
import classNames from 'classnames';
import t from '../utilities/translate';

export default class BreedButtonView extends React.Component {
  static propTypes = {
    onClick: PropTypes.func.isRequired,
    disabled: PropTypes.bool
  }

  constructor(props) {
    super(props);
    this.state = {
      tempDisabled: false
    };
  }

  render() {
    let _this = this;
    const handleClick = () => {
      if (!_this.state.tempDisabled) {
        _this.props.onClick();
        _this.setState({tempDisabled: true});
        // Disable the button for a bit to avoid mass breeding
        setTimeout(function() {
          _this.setState({tempDisabled: false});
        }, 500);
      }
    };

    return (
      <div className={classNames('breed-button', { 'disabled': this.props.disabled})} onClick={handleClick}>
        <div className="button-label breed-button-label unselectable">{ t("~FV_EGG_GAME.BREED_BUTTON") }</div>
      </div>
    );
  }
}

@@ -375,51 +375,8 @@
 %0A%0A  
-render() %7B%0A    let _this = this;%0A    const 
 hand
@@ -401,16 +401,13 @@
     
-  
 if (!
-_
 this
@@ -431,27 +431,24 @@
 ed) %7B%0A      
-  
-_
 this.props.o
@@ -459,27 +459,24 @@
 ck();%0A      
-  _
 this.setStat
@@ -506,18 +506,16 @@
 ;%0A      
- 
- 
 // Disab
@@ -567,17 +567,28 @@
 g%0A      
- 
+this.timer =
  setTime
@@ -595,18 +595,13 @@
 out(
-function()
+() =%3E
  %7B%0A 
@@ -611,11 +611,8 @@
     
-  _
 this
@@ -643,24 +643,49 @@
  false%7D);%0A  
+      this.timer = null;%0A
       %7D, 500
@@ -695,19 +695,188 @@
     
+%7D%0A
   %7D%0A
+%0A
   
-  %7D;%0A
+componentWillUnmount() %7B%0A    if (this.timer) %7B%0A      clearTimeout(this.timer);%0A    %7D%0A  %7D%0A%0A  render() %7B%0A    const disabled = this.props.disabled %7C%7C this.state.tempDisabled;
 %0A   
@@ -940,17 +940,16 @@
 , %7B 
-'
 disabled
 ': t
@@ -948,30 +948,9 @@
 bled
-': this.props.disabled
+ 
 %7D)%7D 
@@ -958,16 +958,21 @@
 nClick=%7B
+this.
 handleCl

Fix React warning about calling setState on unmounted component