<commit_before>import { useEffect, memo } from 'react';
import { attempt } from 'lodash-es';
import useChart from '../UseChart';
import useModifiedProps from '../UseModifiedProps';

const Title = memo((props) => {

  const { getChart, needsRedraw } = useChart();

  const modifiedProps = useModifiedProps(props, true);

  const updateTitle = config => {
    const chart = getChart();
    chart.setTitle(config, null, false);
    needsRedraw();
  }

  useEffect(() => {
    if (modifiedProps !== false) {
      updateTitle(modifiedProps);
    }
  // eslint-disable-next-line react-hooks/exhaustive-deps
  },[props]);

  useEffect(() => {
    return () => attempt(updateTitle, { text: null });
  // eslint-disable-next-line react-hooks/exhaustive-deps
  },[]);

  return null;
})

export default Title;
<commit_msg>Add displayName to Title<commit_after>import { useEffect, memo } from 'react';
import { attempt } from 'lodash-es';
import useChart from '../UseChart';
import useModifiedProps from '../UseModifiedProps';

const Title = memo((props) => {

  const { getChart, needsRedraw } = useChart();

  const modifiedProps = useModifiedProps(props, true);

  const updateTitle = config => {
    const chart = getChart();
    chart.setTitle(config, null, false);
    needsRedraw();
  }

  useEffect(() => {
    if (modifiedProps !== false) {
      updateTitle(modifiedProps);
    }
  // eslint-disable-next-line react-hooks/exhaustive-deps
  },[props]);

  useEffect(() => {
    return () => attempt(updateTitle, { text: null });
  // eslint-disable-next-line react-hooks/exhaustive-deps
  },[]);

  return null;
})

Title.displayName = 'Title';

export default Title;

{'fraction_non_alphanumeric': 0.15776844631073786, 'fraction_numerical': 0.0, 'mean_word_length': 3.6985915492957746, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '254893', 'n_tokens_mistral': 523, 'n_tokens_neox': 512, 'n_words': 121}