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

export default function asyncComponent(getComponent, loadingChildren = null) {
  return class AsyncComponent extends PureComponent {
    static Component = null;
    static async loadComponent() {
      const { default: Component } = await getComponent();
      AsyncComponent.Component = Component;
      return Component;
    }

    state = { Component: AsyncComponent.Component };
    mounted = false;

    async componentWillMount() {
      if (!AsyncComponent.Component) {
        const Component = await AsyncComponent.getComponent();
        if (this.mounted) {
          this.setState({ Component });
        }
      } else if (!this.state.Component) {
        this.setState({ Component: AsyncComponent.Component });
      }
    }

    componentDidMount() {
      this.mounted = true;
    }

    componentWillUnmount() {
      this.mounted = false;
    }
    render() {
      const { Component } = this.state;
      if (!Component) {
        return loadingChildren;
      }

      return <Component {...this.props} />;
    }
  };
}
<commit_msg>Fixed the async component naming issue<commit_after>import React, { PureComponent } from 'react';

export default function asyncComponent(getComponent, loadingChildren = null) {
  return class AsyncComponent extends PureComponent {
    static Component = null;
    static async loadComponent() {
      const { default: Component } = await getComponent();
      AsyncComponent.Component = Component;
      return Component;
    }

    state = { Component: AsyncComponent.Component };
    mounted = false;

    async componentWillMount() {
      if (!AsyncComponent.Component) {
        const Component = await AsyncComponent.loadComponent();
        if (this.mounted) {
          this.setState({ Component });
        }
      } else if (!this.state.Component) {
        this.setState({ Component: AsyncComponent.Component });
      }
    }

    componentDidMount() {
      this.mounted = true;
    }

    componentWillUnmount() {
      this.mounted = false;
    }
    render() {
      const { Component } = this.state;
      if (!Component) {
        return loadingChildren;
      }

      return <Component {...this.props} />;
    }
  };
}

{'fraction_non_alphanumeric': 0.10913930789707187, 'fraction_numerical': 0.0, 'mean_word_length': 2.5344827586206895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4141286', 'n_tokens_mistral': 591, 'n_tokens_neox': 573, 'n_words': 147}