<commit_before>import React from 'react';
import Preload from 'react-preload';
import Spinner from './Spinner';

const imgBase = 'https://api.fnkr.net/testimg/800x600/00CED1/FFF/?';

export class Example1 extends React.Component {
    _handleImageLoadError = (failedImages) => {
        this.setState({
            preloadError: true,
        });
    }

    _handleImageLoadSuccess = () => {
    }

    componentWillMount() {
        this.setState({
            cacheBreaker: Date.now(),
        })
    }

    render() {

        const images = [
            `${imgBase}text=1-${this.state.cacheBreaker}`,
            `${imgBase}text=2-${this.state.cacheBreaker}`,
            `${imgBase}text=3-${this.state.cacheBreaker}`,
            `https://not-a-real-image-url`,
        ];

        return (
            <Preload

                images={images}
                onError={this._handleImageLoadError}
                onSuccess={this._handleImageLoadSuccess}
                mountChildren
                resolveOnError
            >
                <div><commit_msg>Fix loading indicator example<commit_after>import React from 'react';
import Preload from 'react-preload';
import Spinner from './Spinner';

const imgBase = 'https://api.fnkr.net/testimg/800x600/00CED1/FFF/?';

export class Example1 extends React.Component {
    _handleImageLoadError = (failedImages) => {
        this.setState({
            preloadError: true,
        });
    }

    _handleImageLoadSuccess = () => {
    }

    componentWillMount() {
        this.setState({
            cacheBreaker: Date.now(),
        })
    }

    render() {

        const images = [
            `${imgBase}text=1-${this.state.cacheBreaker}`,
            `${imgBase}text=2-${this.state.cacheBreaker}`,
            `${imgBase}text=3-${this.state.cacheBreaker}`,
            `https://not-a-real-image-url`,
        ];

        return (
            <Preload
                images={images}
                onError={this._handleImageLoadError}
                onSuccess={this._handleImageLoadSuccess}
                loadingIndicator={<Spinner />}
                mountChildren
                resolveOnError
            >
                <div>
{'fraction_non_alphanumeric': 0.13, 'fraction_numerical': 0.011818181818181818, 'mean_word_length': 1.8002544529262086, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, 'https://': 4, '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': '7186769', 'n_tokens_mistral': 647, 'n_tokens_neox': 621, 'n_words': 93}