<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';

class Announcer extends Component {
    static propTypes = {
        text: PropTypes.string,
        politeness: PropTypes.string
    }

    static defaultProps = {
        politeness: 'polite'
    }

    render() {
        const { text, politeness } = this.props;

        return (
            <div aria-live={politeness}>
                <p>{text}</p>
            </div>
        )
    }
}

export default Announcer;<commit_msg>Output null if no text prop is defined<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';

class Announcer extends Component {
    static propTypes = {
        text: PropTypes.string,
        politeness: PropTypes.string
    }

    static defaultProps = {
        politeness: 'polite'
    }

    render() {
        const { text, politeness } = this.props;

        return (
            <div aria-live={politeness}>
                {
                    text.length ?
                    <p>{text}</p> :
                    null
                }
            </div>
        )
    }
}

export default Announcer;
{'fraction_non_alphanumeric': 0.10324232081911262, 'fraction_numerical': 0.0, 'mean_word_length': 1.6478555304740405, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3169440', 'n_tokens_mistral': 328, 'n_tokens_neox': 318, 'n_words': 80}