<commit_before>import React, { Component, PropTypes } from 'react';
var _ = require("lodash");

import FromMessage from "./FromMessage";

export default class Messages extends Component {
	render() {
		const messages = this.props.messages;

		const messageList = messages.map(message => {
			return (
				<FromMessage message={message} />
			);
		});

		return (
			<div className="messages">
				{messageList}
			</div>
		);
	}
}<commit_msg>autoscroll after adding new message<commit_after>import React, { Component, PropTypes } from 'react';
var _ = require("lodash");

import FromMessage from "./FromMessage";

export default class Messages extends Component {
	componentDidUpdate() {
		var node = React.findDOMNode(this.refs.mainDiv);
		node.scrollTop = node.scrollHeight;
	}

	render() {
		const messages = this.props.messages;

		const messageList = messages.map(message => {
			return (
				<FromMessage message={message} />
			);
		});

		return (
			<div className="messages" ref="mainDiv">
				{messageList}
			</div>
		);
	}
}
{'fraction_non_alphanumeric': 0.1369334619093539, 'fraction_numerical': 0.0, 'mean_word_length': 3.850467289719626, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5737780', 'n_tokens_mistral': 358, 'n_tokens_neox': 310, 'n_words': 77}