<commit_before>import React, { Component } from 'react';
import createHistory from 'history/createHashHistory';
import PropTypes from 'prop-types';
import { updateRoute } from '../actions';
import { countSlides } from './slides';

import theme from '../themes/default';
import Context from './context';

const history = createHistory();

export default class Controller extends Component {
  static propTypes = {
    children: PropTypes.node,
    history: PropTypes.object,
    onStateChange: PropTypes.func.isRequired,
    store: PropTypes.object,
    theme: PropTypes.object
  };

  constructor(props) {
    super(...arguments);

    this.history = props.history || history;
  }

  state = {
    print: false
  };

  componentDidMount() {
    this.unlisten = this.history.listen(this._updateRoute.bind(this));
    const location = this.history.location;
    const slideCount = countSlides(this.props.children.props.children);
    this.props.store.dispatch(
      updateRoute({
        location,
        slideCount
      })
    );
  }<commit_msg>Fix: ``createHashHistory`` import syntax (#662)<commit_after>import React, { Component } from 'react';
import { createHashHistory } from 'history';
import PropTypes from 'prop-types';
import { updateRoute } from '../actions';
import { countSlides } from './slides';

import theme from '../themes/default';
import Context from './context';

const history = createHashHistory();

export default class Controller extends Component {
  static propTypes = {
    children: PropTypes.node,
    history: PropTypes.object,
    onStateChange: PropTypes.func.isRequired,
    store: PropTypes.object,
    theme: PropTypes.object
  };

  constructor(props) {
    super(...arguments);

    this.history = props.history || history;
  }

  state = {
    print: false
  };

  componentDidMount() {
    this.unlisten = this.history.listen(this._updateRoute.bind(this));
    const location = this.history.location;
    const slideCount = countSlides(this.props.children.props.children);
    this.props.store.dispatch(
      updateRoute({
        location,
        slideCount
      })
    );
  }
{'fraction_non_alphanumeric': 0.1239396795475966, 'fraction_numerical': 0.001413760603204524, 'mean_word_length': 3.4414225941422596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7185918', 'n_tokens_mistral': 591, 'n_tokens_neox': 587, 'n_words': 146}