<commit_before>import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';

export default class InkTransition extends Component {
  constructor(props) {
    super(props);
    this.state = { timeout: null };
  }

  static propTypes = {
    style: PropTypes.object.isRequired,
    transitionEnterTimeout: PropTypes.number.isRequired,
    transitionLeaveTimeout: PropTypes.number.isRequired,
  };

  static defaultProps = {
    transitionEnterTimeout: 150,
    transitionLeaveTimeout: 450,
  };

  componentWillEnter = (done) => {
    const node = ReactDOM.findDOMNode(this);
    setTimeout(() => {
      node.classList.add('active');
      setTimeout(() => {
        done();
      }, this.props.transitionEnterTimeout);
    }, 25);
  };

  componentWillLeave = (done) => {
    const node = ReactDOM.findDOMNode(this);
    node.classList.add('leaving');
    setTimeout(() => {
      done();
    }, this.props.transitionLeaveTimeout);
  };

  render() {
    return <div className="md-ink" {...this.props} />;
  }
}<commit_msg>Fixed ink errors when components were unmounting<commit_after>import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';

export default class InkTransition extends Component {
  constructor(props) {
    super(props);
    this.state = { timeout: null };
  }

  static propTypes = {
    style: PropTypes.object.isRequired,
    transitionEnterTimeout: PropTypes.number.isRequired,
    transitionLeaveTimeout: PropTypes.number.isRequired,
  };

  static defaultProps = {
    transitionEnterTimeout: 150,
    transitionLeaveTimeout: 450,
  };

  componentWillUnmount() {
    if(this.state.timeout) { clearTimeout(this.state.timeout); }
  }

  componentWillEnter = (done) => {
    const node = ReactDOM.findDOMNode(this);
    const timeout = setTimeout(() => {
      node.classList.add('active');
      const timeout = setTimeout(() => {
        this.setState({ timeout: null });
        done();
      }, this.props.transitionEnterTimeout);
      this.setState({ timeout });
    }, 25);

    this.setState({ timeout });
  };

  componentWillLeave = (done) => {
    const node = ReactDOM.findDOMNode(this);
    node.classList.add('leaving');
    const timeout = setTimeout(() => {
      this.setState({ timeout: null });
      done();
    }, this.props.transitionLeaveTimeout);
    this.setState({ timeout });
  };

  render() {
    return <div className="md-ink" {...this.props} />;
  }
}
{'fraction_non_alphanumeric': 0.14303128809427063, 'fraction_numerical': 0.00650142218610321, 'mean_word_length': 3.3117338003502628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '216047', 'n_tokens_mistral': 722, 'n_tokens_neox': 715, 'n_words': 147}