<commit_before>import React, { Component } from 'react'
import Game from '../lib/Game'

export default class Board extends Component {
	componentDidMount() {
    new Game(this.refs.game, this.props.width, this.props.height).start()
  }

  render() {
		return <div ref="game"></div>
  }
}<commit_msg>Canvas Hot Module Replacement<commit_after>import React, { Component } from 'react'
import Game from '../lib/Game'

export default class Board extends Component {
	componentDidMount() {
    new Game(this.refs.game, this.props.width, this.props.height).start()
  }

	componentDidUpdate() {
		if (module.hot) {
			this.refs.game.removeChild(this.refs.game.firstChild)
			new Game(this.refs.game, this.props.width, this.props.height).start()	
		}
	}

  render() {
		return <div ref="game"></div>
  }
}
{'fraction_non_alphanumeric': 0.15056461731493098, 'fraction_numerical': 0.0, 'mean_word_length': 3.9875, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1038291', 'n_tokens_mistral': 273, 'n_tokens_neox': 255, 'n_words': 59}