import React, { PropTypes } from 'react'; /** * How many console messages to store * @type {Number} */ const consoleMax = 5; class Console extends React.Component { constructor(props) { super(props); /** * An array of React Elements that include previous console messages * @type {Array} */ this.children = []; } shouldComponentUpdate(nextProps) { // clear children if paused, but only update when new consoleEvent happens if (!nextProps.isPlaying) { this.children = []; } return nextProps.consoleEvent !== this.props.consoleEvent; } render() { const args = this.props.consoleEvent.arguments; const method = this.props.consoleEvent.method; const nextChild = (