<commit_before>import React, {Component} from 'react';

import InstantSearch from '../src/InstantSearch';
import SearchBox from '../src/impl/SearchBox';
import Hits from '../src/impl/Hits';
import Pagination from '../src/impl/Pagination';
import HitsPerPage from '../src/impl/HitsPerPage';

import RefinementList from './RefinementList';

class Movie extends Component {
  render() {
    return (
      <div>
        <img src={this.props.hit.image} />
        {this.props.hit.title}
      </div>
    );
  }
}

class App extends Component {
  constructor() {
    super();

    this.state = {
      facet: 'genre',
    };
  }

  onSwitchClick = () => {
    this.setState(state => ({
      facet: state.facet === 'genre' ? 'year' : 'genre',
    }));
  };

  render() {
    return (
      <InstantSearch
        appId="latency"
        apiKey="6be0576ff61c053d5f9a3225e2a90f76"
        indexName="movies"
      >
        <div>
          <button onClick={this.onSwitchClick}>Switch facet</button>
          <RefinementList attributeName={this.state.facet} />
          <HitsPerPage
            defaultValue={5}
            options={[
              {label: '5', value: 5},
              {label: '10', value: 10},
            ]}
          />
          <SearchBox />
          <Pagination />
          <Hits
            itemComponent={Movie}
            // hitsPerPage={5}
          />
        </div>
      </InstantSearch>
    );
  }
}

export default App;
<commit_msg>Update example<commit_after>import React, {Component} from 'react';

import InstantSearch from '../src/InstantSearch';
import SearchBox from '../src/impl/SearchBox';
import Hits from '../src/impl/Hits';
import Pagination from '../src/impl/Pagination';
import HitsPerPage from '../src/impl/HitsPerPage';
import ScrollTo from '../src/impl/ScrollTo';

import RefinementList from './RefinementList';

class Movie extends Component {
  render() {
    return (
      <div>
        <img src={this.props.hit.image} />
        {this.props.hit.title}
      </div>
    );
  }
}

class App extends Component {
  constructor() {
    super();

    this.state = {
      facet: 'genre',
    };
  }

  onSwitchClick = () => {
    this.setState(state => ({
      facet: state.facet === 'genre' ? 'year' : 'genre',
    }));
  };

  render() {
    return (
      <InstantSearch
        appId="latency"
        apiKey="6be0576ff61c053d5f9a3225e2a90f76"
        indexName="movies"
      >
        <div>
          <button onClick={this.onSwitchClick}>Switch facet</button>
          <RefinementList attributeName={this.state.facet} />
          <ScrollTo>
            <HitsPerPage
              defaultValue={5}
              values={[5, 10]}
            />
          </ScrollTo>
          <SearchBox focusShortcuts={['s']} />
          <Pagination showLast maxPages={10} translations={{ next: 'Next' }} />
          <Hits
            itemComponent={Movie}
            // hitsPerPage={5}
          />
        </div>
      </InstantSearch>
    );
  }
}

export default App;

{'fraction_non_alphanumeric': 0.150730411686587, 'fraction_numerical': 0.018924302788844622, 'mean_word_length': 1.9980099502487563, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, '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': '2484348', 'n_tokens_mistral': 982, 'n_tokens_neox': 947, 'n_words': 184}