<commit_before>import React, { Component } from 'react'
import { CommentItem } from './comment-item';
import { CommentsPagination } from './comments-pagination';

import { uxToHex } from '../../lib/util';
import { api } from '../../api';

export class Comments extends Component {

  componentDidMount() {
    let page = "page" + this.props.commentPage;
    if (!this.props.comments || !this.props.comments[page]) {
      this.setState({requested: this.props.commentPage});
      api.getCommentsPage(
        this.props.path,
        this.props.url,
        this.props.commentPage);
    }
  }

  componentDidUpdate(prevProps) {
    if (prevProps !== this.props) {<commit_msg>link fe: ensure state is initialized where used<commit_after>import React, { Component } from 'react'
import { CommentItem } from './comment-item';
import { CommentsPagination } from './comments-pagination';

import { uxToHex } from '../../lib/util';
import { api } from '../../api';

export class Comments extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {
    let page = "page" + this.props.commentPage;
    if (!this.props.comments || !this.props.comments[page]) {
      this.setState({requested: this.props.commentPage});
      api.getCommentsPage(
        this.props.path,
        this.props.url,
        this.props.commentPage);
    }
  }

  componentDidUpdate(prevProps) {
    if (prevProps !== this.props) {
{'fraction_non_alphanumeric': 0.15241379310344827, 'fraction_numerical': 0.0, 'mean_word_length': 3.122159090909091, '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': '2646973', 'n_tokens_mistral': 430, 'n_tokens_neox': 431, 'n_words': 98}